I have two panels. First panel(panel-1) has a checkbox. When user checks/unchecks the checkbox, second panel(panel-2) will show/hide. There is one required input text field on panel-2.
Here is my code:
<rich:panel header="panel-1">
<a4j:region>
<tr:selectBooleanCheckbox value="#{bean.isAddingNewUser}" text="Add New User">
<a4j:support event="onclick" reRender="newUserPanel" limitToList="true" ajaxSingle="true"/>
</tr:selectBooleanCheckbox>
</a4j:region>
</rich:panel>
<a4j:outputPanel id="newUserPanel">
<rich:panel header="panel-2" rendered="#{bean.isAddingNewUser}">
<tr:inputText label="Name:" value="#{bean.name}" required="true"/>
</rich:panel>
</a4j:outputPanel>
<tr:panelButtonBar>
<tr:commandButton text="Save" action="#{controller.save}" blocking="true"/>
</tr:panelButtonBar>