Description
Imagine a composite component for a text, where the attribute "asText" decide if a tc:in or a tc:out is used.
<cc:interface> <cc:attribute name="value"/> <cc:attribute name="asText" default="false"/> </cc:interface> <cc:implementation> <tc:in id="in" value="#{cc.attrs.value}" rendered="#{!cc.attrs.asText}"/> <tc:out id="out" value="#{cc.attrs.value}" rendered="#{cc.attrs.asText}"/> </cc:implementation>
Without a layout manager the component show either the tc:in or the tc:out as expected.
Within a segment layout the component use two segments. One for the tc:in and the second for the tc:out.
If "asText=true" the first segment is empty and the second segment shows the tc:out.
If "asText=false" the first segment shows the tc:in and the second segment is empty.
This might be not the expected behavior, which I think is that the composite component uses only one segment.
As a workaround you can wrap the tc:in/tc:out with a panel:
<cc:implementation> <tc:panel id="wrapper"> <tc:in id="in" value="#{cc.attrs.value}" rendered="#{!cc.attrs.asText}"/> <tc:out id="out" value="#{cc.attrs.value}" rendered="#{cc.attrs.asText}"/> </tc:panel> </cc:implementation>
And the 'rendered' attribute on the composite component container doesn't work within a segment layout which should be definitely fixed.
Attachments
Issue Links
- is related to
-
TOBAGO-2008 AuthorizationHelper not working with composite component expressions
- Closed
-
TOBAGO-2290 Allow style tag in segment layout
- Closed
-
TOBAGO-2291 Allow Jakarta Faces HTML tags in segment layout
- Closed
- relates to
-
TOBAGO-2034 Rendered attribute has no effect for composite components in segment layout
- Closed