[ 
https://issues.apache.org/jira/browse/TOBAGO-1982?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17814769#comment-17814769
 ] 

Verena Schreyer commented on TOBAGO-1982:
-----------------------------------------

The components are not rendered correctly if they are located within a segment 
layout in another component.

Segment layout in parent component:

{code:java}
<tc:segmentLayout large="3seg 9seg">
    <test:component name="test"/>
    <tc:out value="test2"/>
</tc:segmentLayout> {code}
Child component:
{code:java}
<cc:interface>
    <cc:attribute name="name"/>
</cc:interface>

<cc:implementation>
    <tc:out value="#{cc.attrs.name}"/>
</cc:implementation> {code}
Output:
{code:java}
<tobago-segment-layout id="page:user-profile:j_id_6c" class="row">
  <div class="col-lg-3">
    <tobago-out id="..." class="tobago-auto-spacing"><span 
class="form-control-plaintext"></span></tobago-out>
  </div>
  <div class="col-lg-9">
    <tobago-out id="..." class="tobago-auto-spacing"><span 
class="form-control-plaintext">test2</span></tobago-out>
  </div>
</tobago-segment-layout> {code}

> Composite components in segment layout not rendered correctly
> -------------------------------------------------------------
>
>                 Key: TOBAGO-1982
>                 URL: https://issues.apache.org/jira/browse/TOBAGO-1982
>             Project: MyFaces Tobago
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 4.3.2
>            Reporter: Henning Nöth
>            Assignee: Henning Nöth
>            Priority: Minor
>
> Imagine a composite component for a text, where the attribute "asText" decide 
> if a tc:in or a tc:out is used.
> {code:xml}
> <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>{code}
> 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:
> {code:xml}
> <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>{code}
>  
> (!) And the 'rendered' attribute on the composite component container doesn't 
> work within a segment layout which should be definitely fixed.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to