我想在 JSF 之上使用 PrimeFaces 组件选择某些复选框组中的所有复选框。
我的代码是这样的:
<h:panelGrid columns="2" style="margin-bottom:10px" cellpadding="5">
<p:outputLabel value="Confere:" style="font-weight:bold!important" />
<p:selectManyCheckbox
value="#{funcionarioBean.funcionario.permissaoConfere.stringArray}">
<f:selectItem itemLabel="Consulta" itemValue="C" />
<f:selectItem itemLabel="Edição" itemValue="E" />
<f:selectItem itemLabel="Deleção" itemValue="D" />
<f:selectItem itemLabel="Inclusão" itemValue="I" />
<f:selectItem itemLabel="Relatório" itemValue="R" />
<f:selectItem itemLabel="Check All"/>
</p:selectManyCheckbox>
</h:panelGrid>
<h:panelGrid columns="2" style="margin-bottom:10px" cellpadding="5">
<p:outputLabel value="Visitante:" style="font-weight:bold!important" />
<p:selectManyCheckbox
value="#{funcionarioBean.funcionario.permissaoVisitante.stringArray}">
<f:selectItem itemLabel="Consulta" itemValue="C" />
<f:selectItem itemLabel="Edição" itemValue="E" />
<f:selectItem itemLabel="Deleção" itemValue="D" />
<f:selectItem itemLabel="Inclusão" itemValue="I" />
<f:selectItem itemLabel="Relatório" itemValue="R" />
<f:selectItem itemLabel="Check All"/>
</p:selectManyCheckbox>
</h:panelGrid>
<h:panelGrid columns="2" style="margin-bottom:10px" cellpadding="5">
<p:outputLabel value="Ocorrências:" style="font-weight:bold!important" />
<p:selectManyCheckbox
value="#{funcionarioBean.funcionario.permissaoOcorrencia.stringArray}">
<f:selectItem itemLabel="Consulta" itemValue="C" />
<f:selectItem itemLabel="Edição" itemValue="E" />
<f:selectItem itemLabel="Deleção" itemValue="D" />
<f:selectItem itemLabel="Inclusão" itemValue="I" />
<f:selectItem itemLabel="Relatório" itemValue="R" />
<f:selectItem itemLabel="Check All"/>
</p:selectManyCheckbox>
</h:panelGrid>
我尝试使用此处发布的代码,但它仅适用于页面上只有一组复选框的情况。