aspose file tools*
The moose likes JSF and the fly likes multiple form in xhtml page nad update different controlls on two different forms Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "multiple form in xhtml page nad update different controlls on two different forms" Watch "multiple form in xhtml page nad update different controlls on two different forms" New topic
Author

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

sardar waqas ahmed
Greenhorn

Joined: Oct 19, 2011
Posts: 16
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"
rowClasses="plainRow,shadedRow">

<hutputLabel value="Marital Status : " class="field-title" />
<p:selectOneMenu required="true" id="maritalstatus"
value="#{personalInfoBean.maritialStatusPerson}">
<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:selectOneMenu>

<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" />
<p:inputText
value="#{personalInfoBean.hrNextOfKin.nameNextOfKin}"
required="true" id="nok">
<p:ajax event="blur" update="msg37" />
<f:validateLength minimum="3" maximum="15"></f:validateLength>
</p:inputText>
<p:message for="nok" id="msg37" display="icon" />
<h:commandButton value="Save" action="#personalInfoBean.saveHrNOK}" class="defaultButton" />

</h:form>

<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:inputText>
<p:message for="chlname" id="msgchld" display="icon" />

<hutputLabel value="Gender :" />
<p:selectOneMenu id="chldgender" required="true"
value="#{personalInfoBean.nokChild.childrenGender}">
<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:selectOneMenu>
<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:inputText>
<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}" />
</f:facet>
</h:panelGrid>

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

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


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


</h:form>



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="dlgchild.show()"/>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: multiple form in xhtml page nad update different controlls on two different forms