1 Reply Latest reply on Feb 27, 2012 4:14 AM by Nikolai Alexeev

    How to refresh page elements after sorting extendedDataTable?

    Nikolai Alexeev Newbie

      We use pagination and sorting in our `rich:extendedDataTable` so after table is sorted selected element can move to another page and in this case we select first element on current page, the problem is that it's correctly selected in table (because table itslef is refreshed automatically) but different dependent tabs aren't refreshed and they still show information about previously selected element. I didn't find any events that could trigger rerendering after `rich:extendedDataTable` is sorted so can anyone tell men how to rerender page elements after sorting `rich:extendedDataTable`?

      we use jsf 1.2, richfaces 3.3.3

        • 1. Re: How to refresh page elements after sorting extendedDataTable?
          Nikolai Alexeev Newbie

          Ok, i've found one decision but it's really ugly: i just put javascript inside column header. Something like this:

          <rich:extendedDataTable id="myTable" ...>
               <rich:column id="mask" label="#{msg.mask}" title="#{msg.mask}" sortBy="#{'mask'}" width="15%" sortOrder="ASCENDING">
                   <f:facet name="header">
                       <h:panelGroup>
                           <h:outputText value="#{msg.mask}" title="#{msg.mask}"/>
                           <script type="text/javascript">//<!--
                               refreshTabs();
                           //-->    
                           </script>
                       </h:panelGroup>
                   </f:facet>
                   <h:outputText value="#{item.mask}" title="#{item.mask}"/>
               </rich:column>
               ...
          </rich:extendedDataTable>
          <a4j:jsFunction name="refreshTabs" eventsQueue="queue" reRender="detailsTab, instancesTab, accountsTab"/>
          

          Is there more elegant solution?