0 Replies Latest reply on Jul 29, 2011 5:14 AM by ebrime

    a4j:support on the header of a rich:column in a datatable

    ebrime

      Hi all,

       

      I'am new in this forum, thank you for your help in advance.

       

      My problem is that I want to show an image during the dataTable is sorting, because my datatable is very complex and sorting it is very slow.

       

      I try to do this:

       

       

      <rich:dataTable
      
      
      
      
      
      
      
      
      
         id="tasklist"
         onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
         onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
         cellpadding="0" cellspacing="0" 
         value="#{taskBean.toDoList}" 
         var="task" 
         width="100%"
         styleClass="tablaPaginada"
      >
      
      
      
      
      
      
      
      
         <rich:column rowspan="#{task.interUserListSize + task.externUserListSize + 2}">
      
      
      
            <f:facet name="header">
               <h:outputText value="#{msg.codigoSol}" >
                  <a4j:support event="onclick" 
                     action= "#{taskBean.sort}" 
                     eventsQueue="instancesQueue" 
                     onsubmit="Richfaces.showModalPanel('ajaxLoadingModalBox');" 
                     oncomplete="Richfaces.hideModalPanel('ajaxLoadingModalBox');" 
                     reRender="tasklist"/>
      
      
      
      
      
      
      
      
      
               </h:outputText>
            </f:facet>
            <h:outputLink value="....">
      
      
      
      
      
                     <h:outputText value="#{task.codSolicitud}"/>
            </h:outputLink>
         </rich:column>
      
            ....  more columns
      
      </rich:datatable>
      
      <rich:modalPanel id="ajaxLoadingModalBox" width="120" height="120"  moveable="false" resizeable="false"  >
      
      
         <h:panelGrid columns="1" style="text-align:center">
      
      
      
      
      
            <img src="../../img/ajax-loader.gif" />
            <h:outputText value="#{msg.retardPro}"/>
         </h:panelGrid>
      
      
      
      
      
      
      </rich:modalPanel>
      
      
      

       

       

       

      I implemented my own sort method, and I tried to fired it on the onclick event in the header of the datatable, but the sort method is never fired.

      Any suggestions?

      Someone has another way to do this?

       

      Thank you