0 Replies Latest reply on Mar 8, 2011 11:44 AM by uririch

    rich:column sortexpression

    uririch

      Hi,

      I am having a display issue sorting a scrollable data table column. I am using richfaces 3.3 and jsf 1.2.

       

      The display code:

      <!DOCTYPE html

            PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

      <html xmlns="http://www.w3.org/1999/xhtml"

      xmlns:f="http://java.sun.com/jsf/core"

      xmlns:h="http://java.sun.com/jsf/html"

      xmlns:ui="http://java.sun.com/jsf/facelets"

      xmlns:a4j="http://richfaces.org/a4j"

      xmlns:rich="http://richfaces.org/rich"

      xml:lang="en"lang="en">

       

       

      <head>

       

      <title>UntitledDocument</title>

      <meta http-equiv="Content-Type"content="text/html; charset=iso-8859-1"/>

          <link type="text/css"rel="stylesheet" href="css/global.css"/>

       

      <script src="js/sra.js"type="text/javascript"></script>

       

      </head>

       

      <f:view contentType="text/html;charset=iso-8859-1"/>

      <body>

       

       

      <h:form id="linkform">

      <a4j:commandLink id="wizbutton"onmousedown="Richfaces.showModalPanel('panel');"

             value="Open"

             reRender="panel"/>

       

      </h:form>

       

      <rich:modalPanel id="panel"height="400" width="700">

       

         <f:facet name="header">Search Parts</f:facet>  

         <f:facet name="controls">

         <h:form>

         <h:commandLink value="Close"

         style="cursor:pointer;color:black;"

         onclick="Richfaces.hideModalPanel('panel')" />

         </h:form>

         </f:facet>

       

         <h:form id="srcpartform">

       

         <table>

         <tr>

         <td>

         <label>Part-Number</label>

         </td>

         <td>

         <h:inputText id="pnum"value="#{test.pnum}"/>

         </td>

         </tr>

         <tr>

         <td>

         <label>Part-Description</label>

         </td>

         <td>

         <h:inputText id="pdesc"value="#{test.pdesc}"/>

         </td>

         </tr>

         <tr>

         <td><br></br></td>

         <td>

         <a4j:commandButton id="srcpart"value="Search"

         action="#{test.srcpart}"reRender="srcres" eventsQueue="foo"/>

         <a4j:commandButton id="clpart"value="Close"

         action="#{test.clpart}"/>

       

         <br></br>

       

          <a4j:status id="imgstat"startText="Started" stopText="stopped">

            </a4j:status>  

         </td>

         </tr>             

         </table>

      </h:form>

      <a4j:outputPanel ajaxRendered="true">

       

         <h:panelGrid rendered="#{test.resrender}">

         <h:form>

         <rich:scrollableDataTable id="srcres"value="#{test.partsrcAL}"

                 var="parts"rows="#{test.rowct}" headerClass="dataHeader" columnClass="dataCol"

                 height="200"width="300" sortMode="single">        

                               <rich:column id="part_number"sortExpression="#{parts.part_number}" >

                               <f:facet name="header">                 

                               Part Number                                                                       

                       </f:facet>        

                       <h:outputText value="#{parts.part_number}"/>                    

                       </rich:column>

         </rich:scrollableDataTable>

         </h:form>

         </h:panelGrid>

       

         </a4j:outputPanel>

       

      </rich:modalPanel>

       

      </body>

       

      </html>

       

      Before sort:

      before.jpg

       

      After sort:

      after.jpg

       

      I noticed that, when the column is being sorted the 'update model' phase is not being called. When I click the close button (which for now does nothing, the display is corrected and the sorted column is displayed right. The debug for the close button shows that the 'update model' phase is being called.)

       

      faces.config:

      <managed-bean>
          <managed-bean-name>test</managed-bean-name>
          <managed-bean-class>backing.test</managed-bean-class>
          <managed-bean-scope>session</managed-bean-scope>
        </managed-bean>