1 Reply Latest reply on Jul 10, 2009 10:00 AM by svande

    when table.setRowKey(key) _currentModel == null

    svande

      Hello forum,

      I have been doing selections on scrollable datatables with success.
      However now I have a table where the table model turns out to be empty when getting the row data of the selection.
      The effect is that in UIDataAdaptor.java a temp model is created with the wrong sorting etc.
      Why would the model be empty if I have bindingg and all?

      Here is some java code:

      SimpleSelection selection = new SimpleSelection();
      HtmlScrollableDataTable table;
      selection.getKeys();
      table.setRowKey(key);
      UIDataAdaptor.java: protected ExtendedDataModel getExtendedDataModel()
      if (this._currentModel == null) {...


      This is the table:
      <rich:scrollableDataTable id="processedFilesTable"
       value="#{processedFilesReportExtendedDataModel}"
       var="file"
       width="750px" height="400px"
       rows="#{processedFilesReportExtendedDataModel.getMaxRows(15)}"
       sortOrder="#{processedFilesReportExtendedDataModel.sortOrder}"
       selection="#{processedFilesReport.selection}"
       onselectionchange="onPFSelectionChange();onPFSelectionChange2();"
       binding="#{processedFilesReport.table}"
       process="processedFilesTable"
       reRender="processedFilesTable"
       frozenColCount="1"
       eventsQueue="processedFilesTable"
       ignoreDupResponses="true">


        • 1. Re: when table.setRowKey(key) _currentModel == null
          svande

          Hi,

          I solved this one by getting the selected data immediately on selection change:

          public void onSelectionChange() {
           selectedProcessedFiles = retrieveSelectedProcessedFiles();
          }


          Still I found it strange that when doing it later the model was null.

          Regards,

          Wilfred