4 Replies Latest reply on Mar 9, 2009 1:07 PM by mail.micke

    3.3.0.GA rich:columns sorting problem

    mail.micke

      Hi all

      After upgrading to 3.3.0.GA sorting stopped working for me when using rich:columns, used to work with the earlier version I was using.

      Not sure what is going on, but when inspecting with firebug the ids referenced by the a4j:log warnings below aren't in the page, and certainly not the ids for the *header:sortDiv elements.


      XHTML Code:

      <rich:dataTable id="posListingTable"
       value="#{sdb2.filteredPositionWrappers}"
       var="item"
       rows="25"
       sortMode="single"
       style="width:95%;">
       <f:facet name="header">
       <rich:columnGroup>
       <rich:column colspan="#{sdb2.visibleColumnCount}">
       <rich:datascroller for="posListingTable"
       id="posListScroller"
       page="#{sdb2.scrollerPageNumber}"
       align="left"
       ajaxSingle="false"
       renderIfSinglePage="false"/>
       </rich:column>
       </rich:columnGroup>
       </f:facet>
       <rich:columns
       value="#{sdb2.visibleColumns}"
       sortBy="#{item[col.valueProperty]}"
       sortOrder="ASCENDING"
       styleClass="#{col.colCssClass}"
       style="width:100%;"
       var="col">
       <f:facet name="header">
       <h:outputText value="#{col.header}" escape="false"/>
       </f:facet>
       <lch:floatLeftClickable onclick="#{col.getJsFunction(item.getRealObject())}"
       rendered="#{col.hasJsFunction}"
       id="#{col.valueProperty}">
       <h:graphicImage value="/jsf/_icons/details.gif" align="middle"/>
       </lch:floatLeftClickable>
       #{item[col.valueProperty]}
       </rich:columns>
      </rich:dataTable>
      


      I get some a4j:log warnings:
      warn[15:33:03,672]: Node for replace by response with id sdbForm:posListingTable:j_id746header:sortDiv not found in document
      debug[15:33:03,672]: Update page part from call parameter for ID sdbForm:posListingTable:j_id750header:sortDiv
      debug[15:33:03,672]: call getElementById for id= sdbForm:posListingTable:j_id750header:sortDiv
      warn[15:33:03,673]: Node for replace by response with id sdbForm:posListingTable:j_id750header:sortDiv not found in document
      debug[15:33:03,673]: Update page part from call parameter for ID sdbForm:posListingTable:j_id754header:sortDiv
      debug[15:33:03,673]: call getElementById for id= sdbForm:posListingTable:j_id754header:sortDiv
      warn[15:33:03,674]: Node for replace by response with id sdbForm:posListingTable:j_id754header:sortDiv not found in document
      debug[15:33:03,674]: Update page part from call parameter for ID sdbForm:posListingTable:j_id758header:sortDiv
      debug[15:33:03,674]: call getElementById for id= sdbForm:posListingTable:j_id758header:sortDiv
      warn[15:33:03,675]: Node for replace by response with id sdbForm:posListingTable:j_id758header:sortDiv not found in document
      



      Any help would be very appreciated,
      Micke


        • 1. Re: 3.3.0.GA rich:columns sorting problem

          Hi,

          Please try to define id for columns component like as:


          <rich:columns id="col#{ind}"
           value="#{sdb2.visibleColumns}"
           sortBy="#{item[col.valueProperty]}"
           sortOrder="ASCENDING"
           styleClass="#{col.colCssClass}"
           style="width:100%;"
           var="col"
           index="ind">



          • 2. Re: 3.3.0.GA rich:columns sorting problem
            mail.micke

            Thanks for the quick reply Andrei !

            That got rid of the warning, but nothing gets reRendered :(

            Not sure what the "Scripts updated part count: 0" in the log means but, according to Firebug the sortDivs are in the page with the new ids.


            Here is the last bit of the current a4j:log output :

            debug[16:16:01,885]: Such element exist in document
            debug[16:16:01,885]: call getElementById for id= org.ajax4jsf.queue_script
            debug[16:16:01,886]: Update page part from call parameter for ID sdbForm:posListingTable:tb
            debug[16:16:01,886]: call getElementById for id= sdbForm:posListingTable:tb
            debug[16:16:02,172]: Replace content of node by replaceChild()
            debug[16:16:02,299]: search for elements by name 'script' in element tbody
            debug[16:16:02,306]: Scripts in updated part count : 0
            debug[16:16:02,307]: Update part of page for Id: sdbForm:posListingTable:tb successful
            debug[16:16:02,307]: Update page part from call parameter for ID sdbForm:j_id36
            debug[16:16:02,308]: call getElementById for id= sdbForm:j_id36
            debug[16:16:02,315]: Replace content of node by replaceChild()
            debug[16:16:02,318]: search for elements by name 'script' in element span
            debug[16:16:02,325]: Scripts in updated part count : 0
            debug[16:16:02,325]: Update part of page for Id: sdbForm:j_id36 successful
            debug[16:16:02,326]: Update page part from call parameter for ID sdbForm:j_id68
            debug[16:16:02,326]: call getElementById for id= sdbForm:j_id68
            debug[16:16:02,333]: Replace content of node by replaceChild()
            debug[16:16:02,335]: search for elements by name 'script' in element span
            debug[16:16:02,342]: Scripts in updated part count : 0
            debug[16:16:02,342]: Update part of page for Id: sdbForm:j_id68 successful
            debug[16:16:02,343]: Update page part from call parameter for ID sdbForm:j_id98
            debug[16:16:02,343]: call getElementById for id= sdbForm:j_id98
            debug[16:16:02,344]: Replace content of node by replaceChild()
            debug[16:16:02,345]: search for elements by name 'script' in element dl
            debug[16:16:02,351]: Scripts in updated part count : 0
            debug[16:16:02,352]: Update part of page for Id: sdbForm:j_id98 successful
            debug[16:16:02,352]: Update page part from call parameter for ID sdbForm:posListingTable:col0header:sortDiv
            debug[16:16:02,353]: call getElementById for id= sdbForm:posListingTable:col0header:sortDiv
            debug[16:16:02,356]: Replace content of node by replaceChild()
            debug[16:16:02,357]: search for elements by name 'script' in element div
            debug[16:16:02,363]: Scripts in updated part count : 0
            debug[16:16:02,364]: Update part of page for Id: sdbForm:posListingTable:col0header:sortDiv successful
            debug[16:16:02,364]: Update page part from call parameter for ID sdbForm:posListingTable:col1header:sortDiv
            debug[16:16:02,364]: call getElementById for id= sdbForm:posListingTable:col1header:sortDiv
            debug[16:16:02,367]: Replace content of node by replaceChild()
            debug[16:16:02,369]: search for elements by name 'script' in element div
            debug[16:16:02,375]: Scripts in updated part count : 0
            debug[16:16:02,376]: Update part of page for Id: sdbForm:posListingTable:col1header:sortDiv successful
            debug[16:16:02,376]: Update page part from call parameter for ID sdbForm:posListingTable:col2header:sortDiv
            debug[16:16:02,376]: call getElementById for id= sdbForm:posListingTable:col2header:sortDiv
            debug[16:16:02,379]: Replace content of node by replaceChild()
            debug[16:16:02,380]: search for elements by name 'script' in element div
            debug[16:16:02,387]: Scripts in updated part count : 0
            debug[16:16:02,387]: Update part of page for Id: sdbForm:posListingTable:col2header:sortDiv successful
            debug[16:16:02,388]: Update page part from call parameter for ID sdbForm:posListingTable:col3header:sortDiv
            debug[16:16:02,388]: call getElementById for id= sdbForm:posListingTable:col3header:sortDiv
            debug[16:16:02,391]: Replace content of node by replaceChild()
            debug[16:16:02,392]: search for elements by name 'script' in element div
            debug[16:16:02,398]: Scripts in updated part count : 0
            debug[16:16:02,399]: Update part of page for Id: sdbForm:posListingTable:col3header:sortDiv successful
            debug[16:16:02,399]: Update page part from call parameter for ID sdbForm:posListingTable:col4header:sortDiv
            debug[16:16:02,399]: call getElementById for id= sdbForm:posListingTable:col4header:sortDiv
            debug[16:16:02,402]: Replace content of node by replaceChild()
            debug[16:16:02,404]: search for elements by name 'script' in element div
            debug[16:16:02,410]: Scripts in updated part count : 0
            debug[16:16:02,410]: Update part of page for Id: sdbForm:posListingTable:col4header:sortDiv successful
            debug[16:16:02,411]: Update page part from call parameter for ID sdbForm:posListingTable:col5header:sortDiv
            debug[16:16:02,411]: call getElementById for id= sdbForm:posListingTable:col5header:sortDiv
            debug[16:16:02,414]: Replace content of node by replaceChild()
            debug[16:16:02,415]: search for elements by name 'script' in element div
            debug[16:16:02,422]: Scripts in updated part count : 0
            debug[16:16:02,422]: Update part of page for Id: sdbForm:posListingTable:col5header:sortDiv successful
            debug[16:16:02,422]: Update page part from call parameter for ID sdbForm:posListingTable:col6header:sortDiv
            debug[16:16:02,423]: call getElementById for id= sdbForm:posListingTable:col6header:sortDiv
            debug[16:16:02,426]: Replace content of node by replaceChild()
            debug[16:16:02,427]: search for elements by name 'script' in element div
            debug[16:16:02,433]: Scripts in updated part count : 0
            debug[16:16:02,434]: Update part of page for Id: sdbForm:posListingTable:col6header:sortDiv successful
            debug[16:16:02,434]: Update page part from call parameter for ID sdbForm:posListingTable:col7header:sortDiv
            debug[16:16:02,434]: call getElementById for id= sdbForm:posListingTable:col7header:sortDiv
            debug[16:16:02,437]: Replace content of node by replaceChild()
            debug[16:16:02,438]: search for elements by name 'script' in element div
            debug[16:16:02,445]: Scripts in updated part count : 0
            debug[16:16:02,445]: Update part of page for Id: sdbForm:posListingTable:col7header:sortDiv successful
            debug[16:16:02,445]: Update page part from call parameter for ID sdbForm:posListingTable:col8header:sortDiv
            debug[16:16:02,446]: call getElementById for id= sdbForm:posListingTable:col8header:sortDiv
            debug[16:16:02,449]: Replace content of node by replaceChild()
            debug[16:16:02,450]: search for elements by name 'script' in element div
            debug[16:16:02,456]: Scripts in updated part count : 0
            debug[16:16:02,457]: Update part of page for Id: sdbForm:posListingTable:col8header:sortDiv successful
            debug[16:16:02,457]: Update page part from call parameter for ID sdbForm:posListingTable:col9header:sortDiv
            debug[16:16:02,457]: call getElementById for id= sdbForm:posListingTable:col9header:sortDiv
            debug[16:16:02,460]: Replace content of node by replaceChild()
            debug[16:16:02,462]: search for elements by name 'script' in element div
            debug[16:16:02,468]: Scripts in updated part count : 0
            debug[16:16:02,469]: Update part of page for Id: sdbForm:posListingTable:col9header:sortDiv successful
            debug[16:16:02,469]: Update page part from call parameter for ID sdbForm:posListingTable:col10header:sortDiv
            debug[16:16:02,469]: call getElementById for id= sdbForm:posListingTable:col10header:sortDiv
            debug[16:16:02,472]: Replace content of node by replaceChild()
            debug[16:16:02,473]: search for elements by name 'script' in element div
            debug[16:16:02,480]: Scripts in updated part count : 0
            debug[16:16:02,481]: Update part of page for Id: sdbForm:posListingTable:col10header:sortDiv successful
            debug[16:16:02,481]: Update page part from call parameter for ID sdbForm:posListingTable:col11header:sortDiv
            debug[16:16:02,481]: call getElementById for id= sdbForm:posListingTable:col11header:sortDiv
            debug[16:16:02,484]: Replace content of node by replaceChild()
            debug[16:16:02,485]: search for elements by name 'script' in element div
            debug[16:16:02,492]: Scripts in updated part count : 0
            debug[16:16:02,492]: Update part of page for Id: sdbForm:posListingTable:col11header:sortDiv successful
            debug[16:16:02,492]: Update page part from call parameter for ID sdbForm:posListingTable:col12header:sortDiv
            debug[16:16:02,493]: call getElementById for id= sdbForm:posListingTable:col12header:sortDiv
            debug[16:16:02,496]: Replace content of node by replaceChild()
            debug[16:16:02,497]: search for elements by name 'script' in element div
            debug[16:16:02,503]: Scripts in updated part count : 0
            debug[16:16:02,504]: Update part of page for Id: sdbForm:posListingTable:col12header:sortDiv successful
            debug[16:16:02,504]: Update page part from call parameter for ID sdbForm:posListingTable:col13header:sortDiv
            debug[16:16:02,504]: call getElementById for id= sdbForm:posListingTable:col13header:sortDiv
            debug[16:16:02,507]: Replace content of node by replaceChild()
            debug[16:16:02,508]: search for elements by name 'script' in element div
            debug[16:16:02,515]: Scripts in updated part count : 0
            debug[16:16:02,515]: Update part of page for Id: sdbForm:posListingTable:col13header:sortDiv successful
            debug[16:16:02,515]: Update page part from call parameter for ID sdbForm:posListingTable:col14header:sortDiv
            debug[16:16:02,516]: call getElementById for id= sdbForm:posListingTable:col14header:sortDiv
            debug[16:16:02,519]: Replace content of node by replaceChild()
            debug[16:16:02,520]: search for elements by name 'script' in element div
            debug[16:16:02,527]: Scripts in updated part count : 0
            debug[16:16:02,527]: Update part of page for Id: sdbForm:posListingTable:col14header:sortDiv successful
            debug[16:16:02,527]: Update page part from call parameter for ID sdbForm:posListingTable:col15header:sortDiv
            debug[16:16:02,528]: call getElementById for id= sdbForm:posListingTable:col15header:sortDiv
            debug[16:16:02,531]: Replace content of node by replaceChild()
            debug[16:16:02,532]: search for elements by name 'script' in element div
            debug[16:16:02,538]: Scripts in updated part count : 0
            debug[16:16:02,539]: Update part of page for Id: sdbForm:posListingTable:col15header:sortDiv successful
            debug[16:16:02,539]: Update page part from call parameter for ID sdbForm:posListingTable:col16header:sortDiv
            debug[16:16:02,539]: call getElementById for id= sdbForm:posListingTable:col16header:sortDiv
            debug[16:16:02,543]: Replace content of node by replaceChild()
            debug[16:16:02,544]: search for elements by name 'script' in element div
            debug[16:16:02,550]: Scripts in updated part count : 0
            debug[16:16:02,550]: Update part of page for Id: sdbForm:posListingTable:col16header:sortDiv successful
            debug[16:16:02,551]: Update page part from call parameter for ID sdbForm:posListingTable:col17header:sortDiv
            debug[16:16:02,551]: call getElementById for id= sdbForm:posListingTable:col17header:sortDiv
            debug[16:16:02,554]: Replace content of node by replaceChild()
            debug[16:16:02,555]: search for elements by name 'script' in element div
            debug[16:16:02,562]: Scripts in updated part count : 0
            debug[16:16:02,562]: Update part of page for Id: sdbForm:posListingTable:col17header:sortDiv successful
            debug[16:16:02,562]: Update page part from call parameter for ID sdbForm:posListingTable:col18header:sortDiv
            debug[16:16:02,563]: call getElementById for id= sdbForm:posListingTable:col18header:sortDiv
            debug[16:16:02,566]: Replace content of node by replaceChild()
            debug[16:16:02,567]: search for elements by name 'script' in element div
            debug[16:16:02,573]: Scripts in updated part count : 0
            debug[16:16:02,574]: Update part of page for Id: sdbForm:posListingTable:col18header:sortDiv successful
            debug[16:16:02,574]: Update page part from call parameter for ID sdbForm:posListingTable:col19header:sortDiv
            debug[16:16:02,574]: call getElementById for id= sdbForm:posListingTable:col19header:sortDiv
            debug[16:16:02,577]: Replace content of node by replaceChild()
            debug[16:16:02,578]: search for elements by name 'script' in element div
            debug[16:16:02,585]: Scripts in updated part count : 0
            debug[16:16:02,585]: Update part of page for Id: sdbForm:posListingTable:col19header:sortDiv successful
            debug[16:16:02,586]: Update page part from call parameter for ID sdbForm:posListingTable:col20header:sortDiv
            debug[16:16:02,586]: call getElementById for id= sdbForm:posListingTable:col20header:sortDiv
            debug[16:16:02,589]: Replace content of node by replaceChild()
            debug[16:16:02,590]: search for elements by name 'script' in element div
            debug[16:16:02,597]: Scripts in updated part count : 0
            debug[16:16:02,597]: Update part of page for Id: sdbForm:posListingTable:col20header:sortDiv successful
            debug[16:16:02,597]: Update page part from call parameter for ID sdbForm:posListingTable:col21header:sortDiv
            debug[16:16:02,598]: call getElementById for id= sdbForm:posListingTable:col21header:sortDiv
            debug[16:16:02,601]: Replace content of node by replaceChild()
            debug[16:16:02,602]: search for elements by name 'script' in element div
            debug[16:16:02,608]: Scripts in updated part count : 0
            debug[16:16:02,609]: Update part of page for Id: sdbForm:posListingTable:col21header:sortDiv successful
            debug[16:16:02,609]: Update page part from call parameter for ID sdbForm:posListingTable:col22header:sortDiv
            debug[16:16:02,610]: call getElementById for id= sdbForm:posListingTable:col22header:sortDiv
            debug[16:16:02,612]: Replace content of node by replaceChild()
            debug[16:16:02,614]: search for elements by name 'script' in element div
            debug[16:16:02,620]: Scripts in updated part count : 0
            debug[16:16:02,620]: Update part of page for Id: sdbForm:posListingTable:col22header:sortDiv successful
            debug[16:16:02,621]: Update page part from call parameter for ID sdbForm:posListingTable:col23header:sortDiv
            debug[16:16:02,621]: call getElementById for id= sdbForm:posListingTable:col23header:sortDiv
            debug[16:16:02,624]: Replace content of node by replaceChild()
            debug[16:16:02,625]: search for elements by name 'script' in element div
            debug[16:16:02,632]: Scripts in updated part count : 0
            debug[16:16:02,632]: Update part of page for Id: sdbForm:posListingTable:col23header:sortDiv successful
            debug[16:16:02,632]: Update page part from call parameter for ID sdbForm:posListingTable:col24header:sortDiv
            debug[16:16:02,633]: call getElementById for id= sdbForm:posListingTable:col24header:sortDiv
            debug[16:16:02,635]: Replace content of node by replaceChild()
            debug[16:16:02,637]: search for elements by name 'script' in element div
            debug[16:16:02,643]: Scripts in updated part count : 0
            debug[16:16:02,643]: Update part of page for Id: sdbForm:posListingTable:col24header:sortDiv successful
            debug[16:16:02,644]: Update page part from call parameter for ID sdbForm:posListingTable:col25header:sortDiv
            debug[16:16:02,644]: call getElementById for id= sdbForm:posListingTable:col25header:sortDiv
            debug[16:16:02,647]: Replace content of node by replaceChild()
            debug[16:16:02,648]: search for elements by name 'script' in element div
            debug[16:16:02,655]: Scripts in updated part count : 0
            debug[16:16:02,655]: Update part of page for Id: sdbForm:posListingTable:col25header:sortDiv successful
            debug[16:16:02,655]: Update page part from call parameter for ID sdbForm:posListingTable:col26header:sortDiv
            debug[16:16:02,656]: call getElementById for id= sdbForm:posListingTable:col26header:sortDiv
            debug[16:16:02,659]: Replace content of node by replaceChild()
            debug[16:16:02,660]: search for elements by name 'script' in element div
            debug[16:16:02,668]: Scripts in updated part count : 0
            debug[16:16:02,668]: call getElementById for id= org.ajax4jsf.oncomplete
            debug[16:16:02,669]: Processing updates finished, no oncomplete function to call
            debug[16:16:02,670]: Update part of page for Id: sdbForm:posListingTable:col26header:sortDiv successful
            debug[16:16:02,670]: call getElementById for id= ajax-view-state
            debug[16:16:02,671]: Hidden JSF state fields: [object HTMLSpanElement]
            debug[16:16:02,672]: Namespace for hidden view-state input fields is undefined
            debug[16:16:02,672]: search for elements by name 'input' in element span
            debug[16:16:02,677]: Replace value for inputs: 80 by new values: 1
            debug[16:16:02,678]: Input in response: javax.faces.ViewState
            debug[16:16:02,679]: Found same input on page with type: hidden
            debug[16:16:02,681]: Found same input on page with type: hidden
            debug[16:16:02,681]: search for elements by name 'INPUT' in element span
            debug[16:16:02,685]: Replace value for inputs: 80 by new values: 0
            debug[16:16:02,685]: call getElementById for id= _A4J.AJAX.focus
            debug[16:16:02,686]: No focus information in response
            



            • 3. Re: 3.3.0.GA rich:columns sorting problem

              Since 3.3.0 columns are created on each ajax request. So they cannot hold their states anymore.
              You can bind all attributes required for proper work of sorting/ filtering features.

              Please try add Ordering property to your column instance:

              <rich:columns
               value="#{sdb2.visibleColumns}"
               sortBy="#{item[col.valueProperty]}"
               sortOrder="#{col.ordering}"
               styleClass="#{col.colCssClass}"
               style="width:100%;"
               var="col">
              


              visibleColumns - should be a list of custom instances with [ordering] property defined.
              ordering type - org.richfaces.model.Ordering.

              • 4. Re: 3.3.0.GA rich:columns sorting problem
                mail.micke

                Excellent, that solved the problem!

                Many thanks,
                Micke