我有两个h:forms
一个表单有两个h:selectonemenu
,第二个表单有p:commandButton
(仅限)
form_one:
h:selectonemenu
s(一个用于国家名称,第二个用于所选城市)
当我选择一个h:selectonemenu
(国家/地区)而城市将会
在第二个h:selectonemenu
一个h:selectonemenu
有3个选项(例如:1.Pakistan,2.China,3.USA)和
第二个h:selectonemenu
有
巴基斯坦
1.1: - 卡拉奇 1.2: - 伊斯兰堡 1.3: - 拉合尔中国
2.1: - Herben 2.2: - 北京USA
3.1: - NYC 3.2:-California
form_two:
p:commandButton
仅提交选定的城市
这是我的问题
当我选择所选国家/地区的任何城市并按p:commandButton
时,它始终显示我
requiredMessage="please Select city"
可以帮我解决这个问题吗?
谢谢!
// outside all forms
<p:messages id="globalId_messages" />
<!--starting of form one-->
<!--Country select-->
<h:selectOneMenu id="oprRoId_select" styleClass="element_spacing"
value="#{generalInformationAction.budgetOprRoBean.budgetOprRoIdBean}"
required="true" requiredMessage="Select Budget Opr Ro">
<f:selectItem itemLabel="OprRoother" itemValue="#{0}" />
<f:selectItems value=" {generalInformationAction.budgetOprRoBean.budgetOprRoMapBean}" />
<f:ajax event="change" render="#{p:component('formationId_select')}"
listener="#{generalInformationAction.getFormationsByIdOnAjax}" />
</h:selectOneMenu>
<!--City select-->
<h:selectOneMenu id="formationId_select" styleClass="element_spacing"
value="#{generalInformationAction.budgetFormationsBean.budgetFormationIdBean}"
required="true"
requiredMessage="please Select city">
<f:selectItem itemLabel="formation" itemValue="#{0}"/>
<f:selectItems value="#{generalInformationAction.budgetFormationsBean.budgetFormationMapBean}" />
<f:ajax event="change"
listener="#{generalInformationAction.getAssignedHeadOfAccountByIdOnAjax}" />
</h:selectOneMenu>
<!--starting of form two -->
<p:tabView id="bcrId_tabview">
<p:tab title="Budget Cash Demands">
<h:form id="bcr_form_4">
<h:panelGrid id="new_demand_panelgrid">
<h:column>
<h:panelGrid id="new_demand_panelgrid"> <h:column>
<p:commandButton id="newDemandId_cmdbutton" value="+ New demand"
process=":#{p:component('formationId_select')}"
update=":#{p:component('globalId_messages')} :#{p:component('formationId_select')}"
action="#{budgetControlRegisterAction.getNewNumberForDemand()}" styleClass="element_spacing"/>
</h:column> </h:panelGrid>
// colsing tags..
更新了问题