0 Replies Latest reply on Jul 2, 2010 5:56 AM by Jeff Reif

    Problem with richfaces and sorting

    Jeff Reif Novice

      hello I have following problem.

       

      I have a panel with search criteria and a search button,

      which updates a table.

       

      Problem: The sorting function don't work after the first click on "search", but only after the second click.

       

       

       

           <a4j:form id="PDFForm">
      
                  <rich:tabPanel
                      switchType="client" id="richTabbedPanel">
                      <rich:tab label="Recherche par Numéro de Mesurage" id="richTab1">
                      
                      <h:panelGrid columns="2" id="panelGrid31"
                          columnClasses="formLayoutLabel,formLayoutText">
      
                          <h:panelGrid columns="2" id="panelGrid34"
                              columnClasses="formLayoutLabel,formLayoutText">
      
                              <h:outputLabel value="#{bundle['commune.nom']}:" for="soc1"
                                  id="communeLabel" />
                              <h:selectOneMenu binding="#{scanMesurageBean.communeSelect1}"
                                  id="soc1" readOnly="false" title="#{bundle['commune.nom.tip']}">
                                  <f:selectItems value="#{scanMesurageBean.communeSelect1.items}"
                                      id="si1" />
                              </h:selectOneMenu>
      
                              <h:outputLabel value="#{bundle['mesurage.numero']}:" for="it1"
                                  id="mesurageLabel" />
                              <h:inputText binding="#{scanMesurageBean.numMesurage}" id="it1"
                                  readOnly="false" title="#{bundle['mesurage.numero.tip']}" validatorMessage="Numéro de Mesurage: Valeur doit être entre 0 et 9999">
                                      <f:validateLongRange maximum="9999" minimum="0"/>
                                  </h:inputText>
                                  
      
                          </h:panelGrid>
      
                          <h:panelGrid columns="1" id="panelGrid55">
                              <a4j:commandButton value="#{bundle['search']}" id="buttonPDF"
                                  title="#{bundle['search.tip']}" styleClass="commandButton"
                                  action="#{scanMesurageBean.processQueryPDF}" reRender="panelList"/>
                          </h:panelGrid>
      
                      </h:panelGrid>
      
                      </rich:tab>
      
                  </rich:tabPanel>
                  
                  </rich:panel>
      
      
                  <a4j:outputPanel id="panelList">
      
                      <rich:panel id="pdfList" rendered="#{scanMesurageBean.pdfRendered}">
                          <f:facet name="header">
                              Tableau des Fichiers PDF
                          </f:facet>
                          <rich:dataTable id="pdfTbl" var="pdf"
                              value="#{scanMesurageBean.pdfTableModel}"
                              binding="#{scanMesurageBean.pdfContentTable}" sortMode="single" 
                               sortOrder="#{scanMesurageBean.order}" >
      
                              <rich:column sortBy="#{pdf.mesurage}" width="60" id="c1">
                                  <f:facet name="header">
                                      <h:outputText value="#{bundle['mesurage.numero.short']}"
                                          id="ot11" />
                                  </f:facet>
                                  <h:outputText value="#{pdf.mesurage}" id="ot12" />
                              </rich:column>
      
                              <rich:column width="20" id="c2" sortBy="#{pdf.no}" >
                                  <f:facet name="header">
                                      <h:outputText value="#{bundle['mesurage.pdf.no']}" id="ot21" />
                                  </f:facet>
                                  <h:outputText value="#{pdf.no}" id="ot22" />
                              </rich:column>
      
                              <rich:column width="70" id="c3" sortBy="#{pdf.type}">
                                  <f:facet name="header">
                                      <h:outputText value="#{bundle['mesurage.pdf.type']}" id="ot31" />
                                  </f:facet>
                                  <h:outputText value="#{pdf.type}" id="ot32" />
                              </rich:column>
      
                              <rich:column width="100" id="c4" sortBy="#{pdf.datePDF}">
                                  <f:facet name="header">
                                      <h:outputText value="#{bundle['mesurage.pdf.date']}" id="ot41" />
                                  </f:facet>
                                  <h:outputText value="#{pdf.date}" id="ot42" />
                              </rich:column>
      
                              <rich:column id="c5" width="150">
                                  <a4j:commandButton value="Visualiser" id="cb1"
                                      onclick="window.open('#{pdf.destination}','#{pdf.filename}')" />
                              </rich:column>
      
      
                          </rich:dataTable>
                      </rich:panel>
                  </a4j:outputPanel>
      
              </a4j:form>
      

       

      scanMesurageBean is a Bean in session Scope.