我有两个复选框。有条件地呈现p:selectOneRadio根据选中的值p:selectManyCheckbox
<h:panelGrid id="userActivationGridcheckbox">
<p:selectManyCheckbox value="#{user.activationModecheckbox}" layout="pageDirection">
<f:selectItem itemLabel="Account Expiration(in days)" itemValue="byEmailcheckbox" />
<f:selectItem itemLabel="Reset User Password" itemValue="byAdmincheckbox" />
<f:ajax event="change" render="userActivationGridcheckbox" />
</p:selectManyCheckbox>
<h:panelGrid id="manualActivationGridcheckbox" rendered="#{user.manualActivationcheckbox}" columns="2">
<p:selectOneRadio value="#{user.activationModecheckbox}" layout="pageDirection">
<f:selectItem itemLabel="label1" itemValue="value1" />
<f:selectItem itemLabel="label2" itemValue="value2" />
<h:outputLabel>label</h:outputLabel>
<h:inputText value="" />
</p:selectOneRadio>
</h:panelGrid>
</h:panelGrid>
当第一个复选框被选中时,则会出现2个单选按钮。当第二个复选框没有被选中时,单选按钮不应该出现。我怎样才能做到这一点?
需要看到你的bean的代码,以帮助您 –
这不是有效的把标签和输入字段作为'
的孩子'。你究竟在那里尝试什么?在未来的问题中,请自行消除代码噪声,以便在完全空白的游乐场项目中以尽可能最小的代码来代码,这些代码仍然可以为您(也就是我们)解决问题。 – BalusC