I have a Button called Add oncilck of add panel needs to be displayed and within the panel there is a cancel button onclick of cancel the panel should be closed my problem is onclicking the add button the panel is coming for a moment and disapperaring. actually i have incuded template_2.xhtml which has .. if i remove from template_2.xhtml the panel is working fine but these warnings are coming like this The form component needs to have a UIForm in its ancestry. Suggestion: enclose the necessary components within i want both of things to work fine and warnings should not come .Here is my codei know the problem that i am using 2 times form in 1 xhtml page but not able to overcome that help me out
`
<h:commandButton value=Add id=show action=# onclick=panelwv.show() ></h:commandButton>
<h:form>
<p:panel id=panel widgetVar=panelwv visible=false header=Add Dependents>
<h:panelGrid id=myPanel columns=3 cellpadding=5 styleClass=text-input>
<h:outputText value=/>
<h:outputLabel value=Name style=font-family: cursive;font-size: 18px;font-weight:normal;/>
<h:inputText id=name value=#{depco.depapp.dep.name} styleClass=border label=First Name />
<h:outputText value=/>
<h:outputLabel value=Relationship style=font-family: cursive;font-size: 18px;font-weight:normal;/>
<h:inputText id=rel value=#{depco.depapp.dep.relationship} styleClass=border label=Relationship />
<h:outputText value=/>
<h:outputLabel value=Date of Birth style=font-family: cursive;font-size: 18px;font-weight:normal;/>
<p:calendar id=dob value=#{depco.depapp.dep.dob} showOn=button label=Date of Birth />
<h:outputText value=/>
<h:outputLabel value=Emp Id />
<h:selectOneMenu value=#{depco.depapp.dep.empId} >
<f:selectItems value=#{coemp.empapp.itemsAvailableSelectOne} var=emp itemLabel=#{emp.empId} itemValue=#{emp.empId} />
<f:converter converterId=employeeConverter />
</h:selectOneMenu>
<h:outputText value=/>
<h:commandButton value=Save action=#{depco.createDepAction()}/>
<h:commandButton action=# id=hide onclick=panelwv.hide() value=cancel/>
</h:panelGrid>
</p:panel>
</h:form>
`