Is it possible to make conditional logic with JSF without JSTL tags?
For example, I created a composite component and want to indicate if the id attribute is specified, then define the id attribute, but if the id attribute is not specified, then do not specify 'id'.
At the moment I should use the rendered attribute, but there are so many duplicates there, with a slight difference in the id indication or not.
<composite:interface> <composite:attribute name="id" /> ... </composite:interface> <composite:implementation> <h:selectOneMenu id="#{cc.attrs.id}" label="#{cc.attrs.label}" value="#{cc.attrs.value}" rendered="#{cc.attrs.id != null}" ...> ... </h:selectOneMenu> <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 make conditional material easier?
Thanks!
source share