3 Replies Latest reply on Oct 15, 2009 5:04 AM by ilya_shaikovsky

    simpleTogglePanel collapse and expand all buttons

      I have a page that renders 1 or more simple toggle panels based on the data set. The client has requested having buttons that would expand or collapse all of togglePanels.

      I assume I can accomplish this with the SimpleTogglePanelManager.toggleOnClient but I am not sure how to get a reference to each of the toggle panels. Is there a method on the SimpleTogglePanelManager that would let me fire the event for all of them?

        • 1. Re: simpleTogglePanel collapse and expand all buttons
          ilya_shaikovsky

          show your current code.

          • 2. Re: simpleTogglePanel collapse and expand all buttons

             

            <rich:dataTable
             id="ListTable" reRender="ListTableDataScroller" var="_item" value="#{data}"
             styleClass="gf-data-table" headerClass="data-table-header" footerClass="data-table-footer" rowClasses="data-table-rows"
             rendered="#{data.rowCount > 0}" rows="10" width="100%">
             <rich:column>
             <rich:simpleTogglePanel switchType="client" width="100%" style="background-image: none;" opened="false">


            There is stuff inside the togglePanel but I don't think that is important. I havent written anything yet to actually do the collapse and expand all. From looking at the code it seems like I should be able to get the list of SimpleTogglePanels from the SimpleTogglePanelManager and call the expand or collapse event on each of them. My problem is I am not a javascript expert by any means so I am not sure how to do that.

            • 3. Re: simpleTogglePanel collapse and expand all buttons
              ilya_shaikovsky

              No there are no method for all the panels. You should call toggleOnClient for every panel and pass panel client id there