<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>
我正在使用两个单选按钮,如果我选择单选按钮,用户名和密码应该验证,否则它不会被验证。请帮助我提前感谢