14 Replies Latest reply on Apr 5, 2010 1:29 PM by Nick Belaevski

    rich:dataTable sorting issue + rich:datascroller 'next' control does not go passed page 2

    Odomitchi Anikpo Newbie

      Hello,

       

      I am using Richfaces 3.3.0, Facelelts 1.1.14 and Seam 2.1.1.

       

      I have  an issue my rich:dataTable component and sorting. I noticed a pattern... the very first click on the table on a column header does nothing then all subsequent clicks on any header including currently ordered one actually performs previously requested order. I tried many different things, but I can't point at what might be causing this which makes it difficult to address the issue. I would really appreciate some help.

       

      The section of my .xhtml file that contains the table looks like this:

       

      ...

       

      <a4j:status id="ajaxstatus" onstart="Richfaces.showModalPanel('statusPanel');" onstop="Richfaces.hideModalPanel('statusPanel');" />

       

      ...

       

      <a4j:form id="myForm">

       

           <rich:contextMenu attached="false" id="menu" submitMode="ajax">

                <rich:menuItem ajaxSingle="true" action="#{myAction.openItem}" value="Open Report" >

                     <a4j:actionparam name="uri" assignTo="#{myAction.selectedItem.uri}" value="{uri}"/>

                </rich:menuItem>

                <rich:menuItem submitMode="server" action="#{myAction.openItem}" value="Open in new window" target="{uri}" onclick="window.open('', 'jsWinId', 'windth=200, height=200, resizable=0')">

                     <a4j:actionparam name="uri" assignTo="#{myAction.selectedItem.uri}" value="{uri}"/>

                </rich:menuItem>

           </rich:contextMenu>

       

           <rich:dataTable id="myTable" var="_myItem" value="#{myAction.allItems}" selectionMode="single" sortMode="single" width="100%" rows="25"  reRender="myForm:myTable,ds" rowClasses="cur"

      onRowMouseOver="this.style.backgroundColor='#F1F1F1'" onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'" rendered="#{not empty myAction.allItems}" >

                <rich:column id="col1" sortBy="#{_myItem.id}" sortOrder="#{myAction.sortOrder['col1']}" label="Transaction ID" width="15%">

                     <f:facet name="header">

                          <h:outputText value="ID"/>

                     </f:facet>

                     #{_myItem.id}

                </rich:column>

                <rich:column id="col2" sortBy="#{_myItem.category}" sortOrder="#{myAction.sortOrder['col2']}" label="Category" width="17%">

                     <f:facet name="header">

                          <h:outputText value="Category"/>

                     </f:facet>

                     #{_myItem.category}

                </rich:column>

           <rich:column id="col3" sortBy="#{_myItem.name}" sortOrder="#{myAction.sortOrder['col3']}" label="Name" width="17%">

                <f:facet name="header">

                     <h:outputText value="Name"/>

                </f:facet>

                #{_myItem.name}

           </rich:column>

           <rich:column id="col4" sortBy="#{_myItem.location}" sortOrder="#{myAction.sortOrder['col4']}" label="Location" width="21%">

                <f:facet name="header">

                     <h:outputText value="Location"/>

                </f:facet>

                #{_myItem.location}

           </rich:column>

           <rich:column id="col5" sortBy="#{_myItem.status}" sortOrder="#{myAction.sortOrder['col5']}" label="Status" width="15%">

                <f:facet name="header">

                     <h:outputText value="Status"/>

                </f:facet>

                #{myAction.statusDescription(_myItem.status)}

           </rich:column>

           <rich:column id="col6" sortBy="#{_myItem.timestamp}" sortOrder="#{myAction.sortOrder['col6']}" label="Timestamp" width="15%">

                <f:facet name="header">

                     <h:outputText value="Timestamp"/>

                </f:facet>

                <h:outputText value="#{_myItem.timestamp}"><s:convertDateTime type="both" pattern="yyyy-MM-dd HH:mm:ss.ss"/></h:outputText>

           </rich:column>

       

       

           <f:facet name="footer">

                <rich:datascroller for="myTable" id="ds" renderIfSinglePage="false" ajaxSingle="false"></rich:datascroller>

           </f:facet>

       

       

           <rich:componentControl event="onRowClick" for="menu" operation="show">

                <f:param name="uri" value="#{_myItem.uri}"/>

           </rich:componentControl>

       

       

        </rich:dataTable>

      </a4j:form>

       

       

      Thanks in advance!