我在 JSF 页面中有以下内容,当我按下重置按钮时,所有值都会重置,除了employeenumber(empnumber)
and phone(phoneno)
,甚至autoComplete(empname)
会重置。这可能是什么原因?
<p:panelGrid columns="6">
<h:outputLabel value="Employee Name" />
<p:autoComplete value="#{myMB.employee}" id="empname"
completeMethod="#{myMB.complete}" converter="myConverter"
var="p" itemLabel="#{p.employeeName}" itemValue="#{p}"
forceSelection="true" >
<p:ajax event="itemSelect" listener="#{myMB.handleSelect}"
update ="empnumber phoneno" />
<p:column>#{p.employeeName} - #{p.employeeNumber}</p:column>
</p:autoComplete>
<p:message id="badgeMessage" for="empname" />
<h:outputLabel value="Employee Number" />
<p:inputText id="empnumber" value="#{myMB.employeeDetail.employeeNumber}" >
</p:inputText>
<p:message id="empnumMessage" for="empnumber" />
<h:outputLabel value="Phone #" for="phoneno" />
<p:inputText id="phoneno" value="#{myMB.employeeDetail.phoneNo}">
</p:inputText>
<p:message id="phoneMessage" for="phoneno" />
</p:panelGrid>
<p:separator />
<p:panelGrid >
<h:outputLabel value="Department" for="department" />
<h:selectOneMenu id="department" value="#{myMB.department}"
converter="departmentConverter">
<f:selectItems value="#{myMB.departmentItems}" var="dept"
itemLabel="#{dept.departmentName}" itemValue="#{dept.departmentCode}"/>
<p:ajax listener="#{myMB.loadDepartments}" />
</h:selectOneMenu>
<p:message id="categoryMessage" for= "department" />
<p:commandButton type="reset" value="Cancel" icon="ui-icon-close"
onclick="myDialog.hide()" />