PrimeFaces输入文本不包含任何值

时间:2016-11-18 12:01:14

标签: jsf primefaces

我正在尝试将值传递给PrimeFaces输入文本组件<p:inputText/>,但是值没有到达bean,bean看到我传递的值为null。

XHTML:

<p:messages id="emessage"  showDetail="true" autoUpdate="true" closable="true"/>
<p:panelGrid columns="2" id="viewp">
     <p:outputLabel value="Old Name:"/>
    <p:inputText value="#{editOrderBean.oldMaterialName}"/>
    <p:outputLabel value="New Name:"/>
    <p:inputText value="#{editOrderBean.newMaterialName}"/>
    </p:panelGrid>
     <br/>
<p:commandButton value="Submit" action="{editOrderBean.editOrder}" 
                 ajax="true" update="emessage" immediate="true"/>

豆:

@ManagedBean
@RequestScoped

private String oldMaterialName;
private String newMaterialName;

public String getOldMaterialName() {
    return oldMaterialName;
}

public void setOldMaterialName(String oldMaterialName) {
    this.oldMaterialName = oldMaterialName;
}


 public String getNewMaterialName() {
    return newMaterialName;
}

public void setNewMaterialName(String newMaterialName) {
    this.newMaterialName = newMaterialName;
}

0 个答案:

没有答案