ICEfaces-EE
  1. ICEfaces-EE
  2. IPCK-147

Nested Composite Component Columns Unrendered By Parent DataTable

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: EE-3.0.0.GA
    • Component/s: Facelet Components
    • Labels:
      None
    • Environment:
      JSF 2.x / IF 2.x
    • Workaround Exists:
      Yes
    • Workaround Description:
      Hide
      The only "work-around" I've seen online thus far is avoiding the issue by writing tables with h:column exposed:
      <h:dataTable>
        <h:column>#{data.one}</h:column>
        <h:column><cc:superColumn>#{data.two}</cc:superColumn></h:column>
      </h:dataTable>
      Show
      The only "work-around" I've seen online thus far is avoiding the issue by writing tables with h:column exposed: <h:dataTable>   <h:column>#{data.one}</h:column>   <h:column><cc:superColumn>#{data.two}</cc:superColumn></h:column> </h:dataTable>

      Description

      Columns in the EE components have their h:column tags wrapped within their composite components, occurring in tables like so:
      <h:dataTable value="#{someBean.someData}" var="data">
        <h:column>#{data.one}</h:column>
        <cc:superColumn>#{data.two}</cc:superColumn>
      </h:dataTable>
      Where it is expected that composite-component abstracted tags are visible to the parents.

      However, only the normal h:column displaying the #{data.one} binding will be rendered.
      1. Screen shot 2010-12-07 at 1.46.04 PM.png
        76 kB

        Issue Links

          Activity

          Hide
          Philip Breau added a comment -

          working as expected now with JSF 2.1

          Show
          Philip Breau added a comment - working as expected now with JSF 2.1
          Hide
          Patrick Corless added a comment -

          Moving to beta 2, doesn't effect the compat version.

          Show
          Patrick Corless added a comment - Moving to beta 2, doesn't effect the compat version.
          Hide
          Nils Lundquist added a comment -

          Failing that a solution can be found to the column issues, a workaround could be using two tag-libs in the ice-cc jar, one using the new composite component interface sans tables, and one using the older style table components.

          Show
          Nils Lundquist added a comment - Failing that a solution can be found to the column issues, a workaround could be using two tag-libs in the ice-cc jar, one using the new composite component interface sans tables, and one using the older style table components.
          Hide
          Nils Lundquist added a comment -

          After using a backing component to identify our composite component as UIColumn to the DataTable, our composite component appears to behave just a a regular h:column would.

          However for composite components to be worthwhile, we need to make use of the cc:insertChildren tag; the composite component tag responsible for the copying of using-page tag-children into the CC. This is performed by the RelocateChildrenListener (a RelocateListener subclass) listening for the PostAddToViewEvent.

          Unfortunately, UIColumn already performs a relocation like this by default, duplicating its contents repeatedly into the respective column of each row. This is performed by com.sun.faces.renderkit.html_basic.BaseTableRenderer during component encoding, which appears to occur after PostAddToViewEvent.

          These two events clash and cause the unpredictable encoding of column and CC contents. With cc:insertChildren removed, the default Column behaviour works. With it present, sometimes the default Column behaviour will display on a re-render (ex. after pressing a button), but normally nothing appear in the column cells.

          The children of the using page appear to be being blanked by the cc:insertChildren event, and when the Column encoding gets to them, there is nothing to render. This is judging from the firing order of the events and the many additional calls to getChildrenCount() (of my backing component) that all return 0, which aren't present when cc:insertChildren is absent.

          Show
          Nils Lundquist added a comment - After using a backing component to identify our composite component as UIColumn to the DataTable, our composite component appears to behave just a a regular h:column would. However for composite components to be worthwhile, we need to make use of the cc:insertChildren tag; the composite component tag responsible for the copying of using-page tag-children into the CC. This is performed by the RelocateChildrenListener (a RelocateListener subclass) listening for the PostAddToViewEvent. Unfortunately, UIColumn already performs a relocation like this by default, duplicating its contents repeatedly into the respective column of each row. This is performed by com.sun.faces.renderkit.html_basic.BaseTableRenderer during component encoding, which appears to occur after PostAddToViewEvent. These two events clash and cause the unpredictable encoding of column and CC contents. With cc:insertChildren removed, the default Column behaviour works. With it present, sometimes the default Column behaviour will display on a re-render (ex. after pressing a button), but normally nothing appear in the column cells. The children of the using page appear to be being blanked by the cc:insertChildren event, and when the Column encoding gets to them, there is nothing to render. This is judging from the firing order of the events and the many additional calls to getChildrenCount() (of my backing component) that all return 0, which aren't present when cc:insertChildren is absent.
          Hide
          Ted Goddard added a comment - - edited

          That looks like an excellent technique. Please try it out.

          Another approach would be to implement a TagHandler, but that will be more complex – the componentType attribute should allow the Renderer to remain a facelet while the backing component is the desired class. A custom TagHandler would require implementation of all three parts (tag, Component, and Renderer).

          Show
          Ted Goddard added a comment - - edited That looks like an excellent technique. Please try it out. Another approach would be to implement a TagHandler, but that will be more complex – the componentType attribute should allow the Renderer to remain a facelet while the backing component is the desired class. A custom TagHandler would require implementation of all three parts (tag, Component, and Renderer).

            People

            • Assignee:
              Patrick Corless
              Reporter:
              Nils Lundquist
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: