我正在使用primefaces的selectOneMenu,我正在尝试在从其他selectOneMenu中选择值后更新一个selectOneMenu。 使用此代码,每件事情都运行正常,我在selectOnemenu中获得更新值。但问题是当我从更新的selectOneMenu选择值时没有反映在bean中 点击按钮后的menas我在我的bean类中获得null值 在这段代码中,我尝试在id为“manufectureName”的selectOneMenu中选择值后,用id“deviceosName”更新selectOneMenu。但是来自selectOneMenu的id为“deviceosName”的select值之后 不反映在豆类中。 我无法弄清楚问题。有人能帮助我吗?
<h:form>
<p:growl id="messages" showDetail="true" autoUpdate="true" />
<p:panel id="os_version_panel" header="Os Version">
<h:panelGrid columns="3" title="Os Version"
style="width:40%;height:20%;padding:10%;padding-left:30%">
<h:outputLabel for="manufectureName" value="Manufecture Name:*"
style="float:right;font-size:15px;width:200px" />
<p:spacer width="20" height="50" />
<p:selectOneMenu id="manufectureName"
value="#{deviceRegistration.selectedManufacture}" effect="fade"
converter="deviceManufactureConverter" style="width:200px">
<f:selectItem itemLabel="Select One" itemValue="" />
<f:selectItems value="#{deviceRegistration.manufactureNameList}"
var="manufacturer" itemLabel="#{manufacturer.manufacturersName}"
itemValue="#{manufacturer}" />
<p:ajax update="deviceosName"
listener="#{deviceRegistration.updateOSName}" />
</p:selectOneMenu>
<h:outputLabel for="deviceosName" value="Device OS Name:*"
style="float:right;font-size:15px;width:200px" />
<p:spacer width="20" height="50" />
<p:selectOneMenu id="deviceosName"
value="#{deviceRegistration.selectedOsName}" effect="fade"
converter="deviceOsNameConverter" style="width:200px">
<f:selectItem itemLabel="Select One" itemValue="" />
<f:selectItems value="#{deviceRegistration.osNamesList}"
var="name" itemLabel="#{name.osName}" itemValue="#{name}" />
</p:selectOneMenu>
<f:facet name="footer">
<p:spacer width="20" height="80" />
<p:commandButton id="addOsVersion" value="Add OS Version"
update="messages" process="os_version_panel"
actionListener="#{deviceRegistration.addOsVersion}"
style="float:right;" />
</f:facet>
</h:panelGrid>
</p:panel>
</h:form>