4 Replies Latest reply on Oct 22, 2008 6:16 AM by Nick Belaevski

    Size of scrollableDataTable

    Vik Glo Newbie

      HI All,

      I have been struggling with HtmlScrollableDataTable. When I am populating a datatable with more than 1 record, my backing bean gives me expected resutls with the values of selected keys. But when my scrollableDataTable has only one resord in it and I select that only record size of the selection is 'zero' where as it should be 1 as there is atleast one record in my datatable. Below is my code please suggest me what to do about this? My version of richfaces is 3.2.1

      private HtmlScrollableDataTable dataTable;
      private SimpleSelection contactSelection;
      /*The following print statement shows me the right size of selected rows when dataTable has more than 1 records but it it shows the size 0 when datatable has only one record in it*/
      System.out.println(dataTable.getSelection().size())
      Iterator iterator = dataTable.getSelection().getKeys();
      while (iterator.hasNext()){
      Object key = iterator.next();
      dataTable.setRowKey(key);
      mytVO = (MyVO) dataTable.getRowData();
      }
      }