Can i do conditional logic with JSF, without JSTL tags ?
For example, i made a composite component, and want to state, if the 'id' attribute is specified, then define the 'id' attribute, but if the 'id' attribute is not specified, then, dont specify the 'id' attribute.
For now i have to use rendered attribute, but so many duplications in there, with only slight difference in specifying id or not.
<composite:interface>
<composite:attribute name="id" />
...
</composite:interface>
<composite:implementation>
<!-- render this when id is specified, id attribute is defined -->
<h:selectOneMenu
id="#{cc.attrs.id}"
label="#{cc.attrs.label}"
value="#{cc.attrs.value}"
rendered="#{cc.attrs.id != null}" ...>
...
</h:selectOneMenu>
<!-- render this when id is not specified, id attribute is NOT defined -->
<h:selectOneMenu
label="#{cc.attrs.label}"
value="#{cc.attrs.value}"
rendered="#{cc.attrs.id == null}" ...>
...
</h:selectOneMenu>
</composite:implementation>
Any ideas to avoid this duplication and do the conditional stuff more easily ?
Thank you !