0
I have the following code
<h:selectOneRadio value="#{solicitacaoImpressaoBean.entrega.tipoGuia}" class="tipoGuia">
<f:selectItems value="#{solicitacaoImpressaoBean.tipoGuia}" var="guia"
itemLabel="#{guia.descricao}" itemValue="#{guia}" />
</h:selectOneRadio>
which does the following :
I would like when the category code is 1 not render the item that is embargo
something like
rendered="#{not solicitacaoImpressaoBean.entrega.peg.categoria.codigo eq 1}"
but how to do this in a selectOneRadio?
<f:selectItem itemValue="2" itemLabel="embargo" itemDisabled="#{requestImpressaoBean.entrega.Peg.categoria.codigo eq 1}" /> actually disables the item, but I would like to delete it, i.e..
– user2509556
And could not not send this option in the list of selectItems? This was my first suggestion, would solve in the back-end.
– prmottajr
How would I do that to an Enum?
– user2509556
It wasn’t documented that you were using an Enum :) I thought it might be a List. Let’s take a step back. Is this requirement not to render the embargo option if the category is "1" functional or screen only? If it is functional I think that maybe the way is to review the modeling so that each Category can indicate the options with which it can relate. But of course I’m suggesting this for you to evaluate, I don’t know the model to know if it’s viable.
– prmottajr
I managed to enable the item by making itemDisabled="#{requestImpressaoBean.entrega.Peg.categoria.codigo eq 1 and guia.codigo eq 3}" now I’m trying to make it disappear via css . Input managed but label still shows with . typeGuia input:disabled {display:None}
– user2509556
managed with css <style> . typeGuia input:disabled , . typeGuia input:disabled ~ label {display:None} </style>
– user2509556
thanks for the help.
– user2509556