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

Add expandAll/collapseAll or toggleAll details for master detail dataTable (detailToggler)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.1.2-SNAPSHOT
    • 1.1.4-SNAPSHOT
    • Extended Datatable
    • None
    • All

    Description

      Add expandAll/collapseAll or toggleAll details for master detail tomahawk dataTable (detailToggler). It seems it can be achieved pretty easily.

      In tomahawk package org.apache.myfaces.component.html.ext HtmlDataTable
      the following methods could be added for that

      public void expandAllDetails()
      {
      int rowCount = getRowCount();

      _expandedNodes.clear();
      for (int row = 0; row < rowCount; row++)

      { _expandedNodes.add(new Integer(row)); }

      }

      public void collapseAllDetails()

      { _expandedNodes.clear(); }

      In tomahawk.tld

      <attribute>
      <name>varDetailToggler</name>
      <required>false</required>
      <rtexprvalue>false</rtexprvalue>
      <description>
      This variable has the boolean property "currentdetailExpanded" which is true if the current detail row is expanded and the action methods
      "toggleDetail" which expand/collapse the current detail row; "expandAllDetails" - expands all detail rows;
      "collapseAllDetails" - collapses all detail rows
      </description>
      </attribute>

      Also it would be nice to have an attribute to allow initial state to be "all expanded", something like allExpandInit="true"

      Thanks a lot,
      --MG

      Attachments

        1. HtmlDataTable-TOMAHAWK-388.java.patch
          1 kB
          Mikhail Grushinskiy

        Issue Links

          Activity

            People

              grantsmith Grant Smith
              mgrouch Mikhail Grushinskiy
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: