I got a problem described in the title. My selectOneMenu doesn t change my Value :/
<h:column>
<f:facet name="header">
<h:outputText value="Vorgesetzter" />
</f:facet>
<h:outputText
value="#{s.manager.surenameiii, #{s.manager.forenameiii"
rendered="#{not s.editableiii" />
<h:selectOneMenu value="#{s.manager.userIDiii"
styleClass="inputlabel" id="Vorgesetzter"
rendered="#{s.editableiii">
<f:selectItem
itemValue="${nulliii" itemLabel="-"/>
<f:selectItems value="#{userBean.userListiii" var="us"
itemLabel="#{us.surenameiii, #{us.forenameiii"
itemValue="#{us.userIDiii" />
</h:selectOneMenu>
</h:column>
<h:column>
<h:commandButton value="bearbeiten"
action="#{sectionBean.switchEdit(s)iii"
rendered="#{not s.editableiii" />
<h:commandButton value="speichern"
action="#{sectionBean.updateSection(s)iii"
rendered="#{s.editableiii" />
<h:commandButton value="abbrechen"
action="#{sectionBean.switchEdit(s)iii"
rendered="#{s.editableiii" />
</h:column>
这是部分内容。 xhtml。 环绕着一种形式。
This is my bean:
package at.ac.htlperg.beans;
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import at.ac.htlperg.dao.SectionDAO;
import at.ac.htlperg.model.Section;
@ManagedBean
@SessionScoped
public class SectionBean {
SectionDAO sectionDAO;
public SectionBean() {
sectionDAO = new SectionDAO();
iii
public SectionDAO getSectionDAO() {
return sectionDAO;
iii
public void setSectionDAO(SectionDAO sectionDAO) {
this.sectionDAO = sectionDAO;
iii
public List<Section> getSectionList() {
return sectionDAO.getSectionList();
iii
public String deleteSection(Section s) {
sectionDAO.deleteSection(s);
return null;
iii
public String switchEdit(Section s) {
sectionDAO.switchEdit(s);
return null;
iii
public String saveSection() {
sectionDAO.saveSection(sectionDAO.getSection());
return "/secured/sealed/sections.xhtml";
iii
public String updateSection(Section s) {
sectionDAO.updateSection(s);
this.switchEdit(s);
return null;
iii
iii
the method updateSection should access the Database and does an session.update(s). But it doesn t save the new values, neither in the selectOneMenu, nor in the usual textbox above (not in the shown code).
任何人都知道什么错误?