手动选择selectOneMenu id="格式";
selectOneMenu id=";格式";工作良好。但是在选择selectOneMenu id="1"的下拉值时;格式";输入的字段输入值为空。
页面
Employee name[Mark] Employee Type [New]
Format [Select some drop down value]
.
电流输出
Employee name[Entered Value Disappeared/null] Employee Type [Selected value disappeared/null]
Format [Selected some drop down value]
预期输出
Employee name[Mark] Employee Type [New]
Format [Selected Value]
.
我已尝试添加
<p:ajax event="valueChange" immediate="true" process="@form" />
The rendering fails if I add it for the selectOneMenu
我有下面的代码
main.xhtml
<h:form id="newFormBank" enctype="multipart/form-data">
<h:panelGroup id="id">
<p:growl id="growl" sticky="true" showDetail="true" />
<p:wizard id="newBankWizard" showNavBar="true" widgetVar="bankWiz" flowListener="#{javaMB.wizardFlow}">
<p:tab id="pro" title="Banks">
<ui:include src="/jsf/xyz.xhtml" />
<ui:include src="/jsf/employeeloan.xhtml" />
</p:tab>
</p:wizard>
</h:panelGroup>
</h:form>
employeeloan.xhtml
<p:panel id="employeeLoan" styleClass="panelNoBorder">
<div class="ui-g"> <div class="ui-g-1"><p:outputLabel value="Employee Name" /></div>
<div class="ui-g-3"> <p:row> <p:inputText id="employeeName" maxlength="50" style="width: 65%;" value="#{javaMB.visaDetailsEntity.employeeName}" > </p:inputText> </p:row> </div>
<div class="ui-g-1"><p:outputLabel value="Employee Type" /></div>
<div class="ui-g-3">
<p:row> <p:selectOneMenu id="employeeTypeList" value="#{javaMB.visaDetailsEntity.employeeTypeCode}" >
<f:selectItem itemLabel="Select Release Type" itemValue=""> </f:selectItem>
<f:selectItem itemLabel="New" itemValue="1" />
<f:selectItem itemLabel="Existing" itemValue="2" /> </p:selectOneMenu> </p:row> </div> </div>
<div class="ui-g"> <div class="ui-g-1"><p:outputLabel value="CREDIT" /></div>
<div class="ui-g-3">
<p:row>
<p:selectOneMenu id="format" value="javaMB.visaDetailsEntity.visaType.visaId">
<f:selectItem itemLabel="VISA" itemValue="1" />
<f:selectItem itemLabel="MASTER CARD" itemValue="2" />
<f:selectItem itemLabel="DISCOVER" itemValue="3" />
<f:selectItem itemLabel="AMERICAN EXPRESS" itemValue="4" />
<f:ajax render="@form" />
</p:selectOneMenu>
</p:row>
</div>
</div>
<div class="ui-g">
<div class="ui-g-1"><p:outputLabel value="VISA" rendered="#{javaMB.visaDetailsEntity.visaType.visaId == '1'}"/></div>
<div class="ui-g-3"> <p:row>
<p:inputText id="visaeg" maxlength="9" size="30" value="#{javaMB.visaDetailsEntity.malaustin}" label="VISA1" rendered="#{javaMB.visaDetailsEntity.visaType.visaId == '1'}">
</p:inputText>
</p:row>
</div>
<div class="ui-g-1"><p:outputLabel value="VISA" rendered="#{javaMB.visaDetailsEntity.visaType.visaId == '1'}"/></div>
<div class="ui-g-3">
<p:row>
<p:inputText id="visaegg" maxlength="11" size="30" value="#{javaMB.visaDetailsEntity.malecinyc}" label="VISA2" onchange="negateLongitude()" rendered="#{javaMB.visaDetailsEntity.visaType.visaId == '1'}">
</p:inputText>
</p:row>
</div>
</div>
<div class="ui-g">
<div class="ui-g-1"><h:outputLabel value="MASTER CARD" style="overflow: hidden" rendered="#{javaMB.visaDetailsEntity.visaType.visaId == '3'}"/></div>
<div class="ui-g-3">
<p:row>
<p:inputText id="masterd" maxlength="7" size="30" value="#{javaMB.visaDetailsEntity.atepmo}" rendered="#{javaMB.visaDetailsEntity.visaType.visaId == '3'}">
</p:inputText>
</p:row>
</div>
<div class="ui-g-1"><h:outputLabel for="masterdt" value="MASTER CARD DETAILS" rendered="#{javaMB.visaDetailsEntity.visaType.visaId == '3'}"/></div>
<div class="ui-g-3">
<p:row>
<p:inputText id="datilsmast" maxlength="8" size="30" value="#{javaMB.visaDetailsEntity.atepllanyc}" rendered="#{javaMB.visaDetailsEntity.visaType.visaId == '3'}">
</p:inputText>
</p:row>
</div>
</div>
<div class="ui-g">
<div class="ui-g-1"><h:outputLabel value="DISCOVER" rendered="#{javaMB.visaDetailsEntity.visaType.visaId == '4'}"/></div>
<div class="ui-g-3">
<p:row>
<p:inputText id="ltdiscover" maxlength="2" size="30" value="#{javaMB.visaDetailsEntity.egrssfo}" rendered="#{javaMB.visaDetailsEntity.visaType.visaId == '4'}">
</p:inputText>
</p:row>
</div>
<div class="ui-g-1"><h:outputLabel value="DISCOVER Details" rendered="#{javaMB.visaDetailsEntity.visaType.visaId == '4'}"/></div>
<div class="ui-g-3">
<p:row>
<p:inputText id="lodiscover" maxlength="4" size="30" value="#{javaMB.visaDetailsEntity.eongtx}" rendered="#{javaMB.visaDetailsEntity.visaType.visaId == '4'}">
</p:inputText>
</p:row>
</div>
</div>
<div class="ui-g">
<div class="ui-g-1"><h:outputLabel value="AExp AZ" rendered="#{javaMB.visaDetailsEntity.visaType.visaId == '2'}"/></div>
<div class="ui-g-3">
<p:row>
<p:inputText id="azaexp" maxlength="2" size="30" value="#{javaMB.visaDetailsEntity.aexpaz}" rendered="#{javaMB.visaDetailsEntity.visaType.visaId == '2'}">
</p:inputText>
</p:row>
</div>
<div class="ui-g-1"><h:outputLabel value="AExp FL" rendered="#{javaMB.visaDetailsEntity.visaType.visaId == '2'}"/></div>
<div class="ui-g-3">
<p:row>
<p:inputText id="flaexp" maxlength="4" size="30" value="#{fvLocationMB.coordinateForm.aexpazfl}" rendered="#{javaMB.visaDetailsEntity.visaType.visaId == '2'}">
</p:inputText>
</p:row>
</div>
</div>
</div>
</p:fieldset>
</p:panel>
</ui:composition>
javaMBgetters setter实体getters setters
您的p:ajax语句是错误的,它可能读起来像:
<p:ajax event="valueChange" update="@form" />
在这里找到内部工作的详尽解释:
了解PrimeFaces进程/更新和JSF f:ajax执行/呈现属性