0 Replies Latest reply on Dec 22, 2009 12:25 PM by Thiagu Mariappan

    outputPanel vanished the data

    Thiagu Mariappan Novice

      hi every one


      i am working on the user registration form , in that form has three check box like (ie . are you Married? are you working ? ) based on the check box selection i need to render the text box input. in the registration from all the user inputs are mandatory.


      this is my sample code.


      <h:form id="form">
      <a:outputPanel ajaxRendered="true">
      <s:validateAll>
      
      <a:region>
      Are you married:
      <h:selectBooleanCheckbox value="#{user.ismarried}" >
      <a:support event="onclick" reRender="spouse" />
      </h:selectBooleanCheckbox>
      </a:region>
      <f:subview id="spouse" rendered="#{user.ismarried}">
      Spouse Name <h:inputText required="true" value="#{user.spouseName}">
      </f:subview>
      
      
      <a:region>
      Are you working:
      <h:selectBooleanCheckbox value="#{user.isemployee}" >
      <a:support event="onclick" reRender="employee" />
      </h:selectBooleanCheckbox>
      </a:region>
      <f:subview id="employee" rendered="#{user.isemployee}">
      company Name <h:inputText required="true" value="#{user.companyName}">
      </f:subview>
      
      </s:validateAll>
      </a:outputPanel>
      </h:form>
      



      this code is working fine , but i am facing the problem when the user select the  first check box and then they enter spouse Name , after that if the user select the second check box , spouse Name text box data getting cleared.


      if i remove the outputPanel the data not getting cleared, but i am getting the issue with  subview render.


      how to resolve this issue.


      thiagu.m