How can I hide a f: selectItem from a p: selectOneRadio in JSF?

1

Here is the code portion of component p: selectOneRadio

<p:selectOneRadio id="console" value="#{archivamientoView.archivamientoDTO.tipoProcesoArchiva}">
                                 <f:selectItem itemLabel="Denuncia"   itemValue="DENU" itemDisabled="#{archivamientoView.itemDenunciaDisabled}" />
                                 <f:selectItem itemLabel="Expediente" itemValue="EXPE" itemDisabled="#{archivamientoView.itemExpedienteDisabled}"/>                          
                            </p:selectOneRadio>

    
asked by Darwin 19.12.2018 в 17:08
source

1 answer

0

You can use the c:if tag.

The first thing is to declare the use of c tags with:

<html xmlns:c="http://java.sun.com/jsp/jstl/core">

After:

<p:selectOneRadio id="console" value="#{archivamientoView.archivamientoDTO.tipoProcesoArchiva}">
    <c:if test="#{archivamientoView.visible}">
        <f:selectItem itemLabel="Denuncia"   itemValue="DENU" itemDisabled="#{archivamientoView.itemDenunciaDisabled}" />
    </c:if>
        <f:selectItem itemLabel="Expediente" itemValue="EXPE" itemDisabled="#{archivamientoView.itemExpedienteDisabled}"/>                          
</p:selectOneRadio>

Finally declare the property boolean visible in your Java class.

Reference: SO EN

    
answered by 24.12.2018 в 15:32