4 Replies Latest reply on Mar 17, 2011 4:17 AM by Ilya Shaikovsky

    Extended data table getTableState is not working as expected

    Hima Kos Newbie

      Hi All,

       

      I am using RichFaces 3.3.3 Final. I have a menuItem to reset table state. getTableState() is not getting called after reset is invoked. Also not sure why getDiagnosticsList is getting called so many time.

       

      Here is output when Reset is clicked:

      GET tableState

      getDiagnosticsList

      SET tableState

      RESET tableState

      SET tableState

      getDiagnosticsList

      getDiagnosticsList

       

      Here is the code:

       

      jsp:

      <rich:menuItem submitMode="ajax" value="Reset" action="#{DiagnosticsListPage.resetState}" reRender="diagnosticsList" />

      .....

      <rich:extendedDataTable value="#{DiagnosticsListPage.diagnosticsList}" id="diagnosticsList" var="diagnostic" tableState="#{DiagnosticsListPage.tableState}" enableContextMenu="false">

       

      Java:

      public ArrayList<FileWrapper> getDiagnosticsList() {

              System.out.println("getDiagnosticsList ");

              return this.diagnosticsFiles; }

       

      public void resetState()

          {

              System.out.println("RESET tableState " );

              String tableState = "{\"columnsVisibility\":{},\"columnGroupingState\":{}," +

                      "\"columnsSizeState\":{\"checkBoxColumn\":\"10%\",\"filename\":\"30%\"," +

                      "\"modified\":\"30%\",\"size\":\"30%\"},\"columnsOrder\":" +

                      "[\"checkBoxColumn\",\"filename\",\"modified\",\"size\"]}";

              setTableState(tableState);      

          }

       

          public void setTableState(String tableState)

          {

              System.out.println("SET tableState ");

              settingsBasic.setStateDiagnosticsList(tableState);

              SettingsBasicDao.save(settingsBasic);

          }

       

          public String getTableState()

          {

              System.out.println("GET tableState ");

              return settingsBasic.getStateDiagnosticsList();

          }