2 Replies Latest reply on Apr 14, 2009 11:35 AM by ammaletu

    RowKeys of ScrollabledateTable changed in 3.3.0?

    ammaletu

      Hi!

      I just tried upgrading from RichFaces 3.2.2 to 3.3.0, but my application throws an error on loading. The error occurs in the method that is bound to the selection attrbute of the rich:scrollableDataTable and which saves the table's selection state in an attribute in a bean as well as setting some flow variables based on the currently selected row.

      To do this, I used to cast the row key of the selected row to an Integer and look the selected item up in the list in the bean. This fails now with a NumberFormatException, because the row key apparently is "srk0". I looked in the Changelog and searched in the forum, but couldn't find any information about changes to the row keys.

      Here is the shortened method:

      public void setTableSelection(SimpleSelection argSelection) {
       ItemWrapper currentItem = null;
       int pos = 0;
      
       // save the table selection
       this.tableSelection = argSelection;
      
       // set the current item flow variables
       if (argSelection.size() == 1) {
       pos = Integer.parseInt(argSelection.getKeys().next().toString());
       if (pos < getItems().size()) {
       currentItem = getItems().get(pos);
       // do something ...
       }
       }
       }


      Any advice what is going wrong here and what I would need to change to be able to upgrade to 3.3.0 would be appreciated. The same code is running fine with 3.2.2.

      I'm working with MyFaces 1.2.5, Spring 2.5.6, Spring WebFlow 2.0.5 and Facelets, by the way.

      Regards,
      Johannes