How do I specify conditions from 2 different beans in a jsf rendered attribute?

rojoca picture rojoca · Jun 17, 2009 · Viewed 26k times · Source

I want to do something along the lines of the following but when I use it like this I get a parse error telling me an entity needs to directly follow the '&' character:

<ice:selectManyCheckbox
rendered="#{!bean1.condition1 && bean2.condition2}"
value="#{bean1.selected}">
<f:selectItems value="#{bean2.items}" />
</ice:selectManyCheckbox>

How can I get rendered to check conditions from 2 different beans?

Answer

karim79 picture karim79 · Jun 17, 2009

Use 'and' instead:

<ice:selectManyCheckbox rendered="#{!bean1.condition1 and bean2.condition2}" value="#{bean1.selected}">