Uploaded image for project: 'MyFaces Tobago'
  1. MyFaces Tobago
  2. TOBAGO-1982

Composite components in segment layout not rendered correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 4.3.2
    • 5.11.0, 6.3.0
    • Core
    • None

    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

          Activity

            People

              bommel Bernd Bohmann
              hnoeth Henning Nöth
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: