Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

multiple form in xhtml page nad update different controlls on two different forms

sardar waqas ahmed
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please tell me i have two form and cant update the command button whic is disable in form 2.i try alot but cant find a solution my code is below.

<h:form id="FamilyInfo">

<h:panelGrid columns="6" cellpadding="7" cellspacing="2"
id="grid3" columnClasses="a,b,c,d"

<hutputLabel value="Marital Status : " class="field-title" />
<p:selectOneMenu required="true" id="maritalstatus"
<f:selectItem itemLabel="Select Maritial Status"></f:selectItem>
<f:selectItem itemLabel="Single" itemValue="Single" />
<f:selectItem itemLabel="Married" itemValue="Married" />
<f:selectItem itemLabel="Widower" itemValue="Widower" />
<f:selectItem itemLabel="Divorce" itemValue="Divorce" />

<p:ajax event="blur" update="msg36" />
<p:ajax event="change" update="childaddbtn"
listener="#{personalInfoBean.handleStatusChange}" />

<p:message for="maritalstatus" id="msg36" display="icon" />
<hutputLabel value=" " class="field-title" />
<hutputLabel value=" " class="field-title" />
<hutputLabel value=" " class="field-title" />

<hutputLabel value="Name next of Kin : " class="field-title" />
required="true" id="nok">
<p:ajax event="blur" update="msg37" />
<f:validateLength minimum="3" maximum="15"></f:validateLength>
<p:message for="nok" id="msg37" display="icon" />
<h:commandButton value="Save" action="#personalInfoBean.saveHrNOK}" class="defaultButton" />


<h:form id="nokChildForm">

<p:dialog header="Children" widgetVar="dlgchild" id="childDlg">

<h:panelGrid columns="3" cellpadding="5">
<hutputLabel value="Name : " />
<p:inputText value="#{personalInfoBean.nokChild.childrenName}"
required="true" id="chlname">
<p:ajax event="blur" update="msgchld" />
<f:validateLength minimum="3" maximum="25"></f:validateLength>
<p:message for="chlname" id="msgchld" display="icon" />

<hutputLabel value="Gender :" />
<p:selectOneMenu id="chldgender" required="true"
<f:selectItem itemLabel="Select Gender" itemValue="" />
<f:selectItem itemLabel="Male" itemValue="Male" />
<f:selectItem itemLabel="Female" itemValue="Female" />
<p:ajax event="blur" update="msgchldGnd" />
<p:message for="chldgender" id="msgchldGnd" display="icon" />

<hutputLabel value="Age :" />
<p:inputText value="#{personalInfoBean.nokChild.childrenAge}"
required="true" id="chldage">
<p:ajax event="blur" update="msgchldage" />
<f:validateLength minimum="1" maximum="3"></f:validateLength>
<p:message for="chldage" id="msgchldage" display="icon" />

<f:facet name="footer">
<p:commandButton value="Save" update="nokChildList"
oncomplete="handleAddChildrenRequest(xhr, status, args)"
actionListener="#{personalInfoBean.setNOKChild}" />

<div style="padding-left: 950px; padding-top: 28px">

<p:commandButton disabled="#{personalInfoBean.addButtonChildren}" value="Add Children" id="childaddbtn" onclick=""/></div>

<h:commandButton value="Save" action="#{personalInfoBean.saveHrNOK}" class="defaultButton" />


when i change dropdown of from one the button on second form should be enabled by default that button is disabled how i do it.this button is not getting enabled when i change the dropdown
<p:commandButton disabled="#{personalInfoBean.addButtonChildren}" value="Add Children" id="childaddbtn" onclick=""/>
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic