Uploaded image for project: 'MyFaces Tomahawk'
  1. MyFaces Tomahawk
  2. TOMAHAWK-346

Patch for detail row in t:dataTable

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.1.2
    • Component/s: None
    • Labels:
      None

      Description

      This is a patch which adds a new feature to t:dataTable.
      This feature is inspired by Oracle ADF table, which has facet called "detailStamp".
      A detail row can be associated to every row in the table, and each detail row has an expanded or collapsed state.
      So, the user can collapse or expand the detail associated to a row.
      The content of the detail row is specified inside the "detailStamp" facet and the user can add a column to the table which is used for expanding or collapsing the detail row.
      Here's an example of usage:

      <t:dataTable varDetailToggler="toggler" value="#

      {testBean.persons}

      " var="item">
      <%-- The Detail Column --%>
      <t:column>
      <f:facet name="header">
      <h:outputText value="Details"/>
      </f:facet>
      <h:commandLink rendered="#

      {toggler.currentDetailExpanded}

      " action="#

      {toggler.toggleDetail}">
      <h:graphicImage url="opened.gif" style="border: none;"/>
      </h:commandLink>
      <h:commandLink rendered="#{!toggler.currentDetailExpanded}" action="#{toggler.toggleDetail}

      ">
      <h:graphicImage url="closed.gif" style="border: none;"/>
      </h:commandLink>
      </t:column>
      <%-- Other columns --%>
      <t:column>
      <f:facet name="header">
      <h:outputText value="Name" />
      </f:facet>
      <h:outputText value="#

      {item.name}

      "></h:outputText>
      </t:column>
      <t:column>
      <f:facet name="header">
      <h:outputText value="Surname" />
      </f:facet>
      <h:outputText value="#

      {item.surname}

      "></h:outputText>
      </t:column>
      <%-- The detail ROW --%>
      <f:facet name="detailStamp">
      <h:outputText value="The current detail..."/>
      </f:facet>
      </t:dataTable>

      As you can see, using the "varDetailToggler" attribute is possible expand/collapse the current detail row (using an action method) and obtaining the state of the current detail row in order to show different command links.

        Attachments

        1. patch.zip
          2 kB
          Claudio Tasso
        2. Patch_ExtendedDataTable_AND_Example.zip
          2 kB
          Claudio Tasso

          Activity

            People

            • Assignee:
              mmarinschek Martin Marinschek
              Reporter:
              tassoc Claudio Tasso
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: