<h:panelGrid id="userActivationGrid" columns="1">
<p:selectOneRadio value="#{user.activationMode}" layout="pageDirection" immediate="true" >
<f:selectItem itemLabel="${adminmsgs['create.avtivateMode.button.label']}" itemValue="${adminmsgs['create.avtivateMode.button.itemvalue.label']}" />
<f:selectItem itemLabel="${adminmsgs['create.avtivateMode1.button.label']}" itemValue="${adminmsgs['create.avtivateMode1.button.itemvalue.label']}" />
<f:ajax event="change" render="userActivationGrid" />
<f:ajax event="click" listener="#{user.tempPassword()}"/>
</p:selectOneRadio>
<p:spacer width="10"/>
<h:panelGrid id="manualActivationGrid" rendered="#{user.manualActivation}" columns="3">
<h:outputLabel>#{adminmsgs['create.manualActivation.text.label']}</h:outputLabel>
<p:inputText id="userName" immediate="true" required="true" value="#{user.userName}" requiredMessage="UserName Should Be Entered" validatorMessage="Username Should Be alphanumeric"/>
<h:message id="userNameMsg" for="userName" />
<h:outputLabel>#{adminmsgs['create.manualActivation1.text.label']}</h:outputLabel>
<p:password id="password" immediate="true" required="true" validatorMessage="password should be minimum 5 character" requiredMessage="Password is Mandatory"/>
<h:message id="passwordMsg" for="password" />
</h:panelGrid>
</h:panelGrid>
i am using two radio buttons and username and password should validate if i select the radio buttton or else it shud not be vaidated .Please help me thanks in advance