1 2 Previous Next 18 Replies Latest reply on Apr 21, 2010 6:03 AM by ilya_shaikovsky Go to original post
      • 15. Re: scrollableDataTable issues with selecting rows
        abcd1

        Hii all

        I am not able to select-all or unselect-all rows in scrollabledatatable??Is there any ways to do it ,like selecting all rows by clicking on a button??

        best regards
        Jayaraj

        • 16. Re: scrollableDataTable issues with selecting rows
          devika.nrgh

          hi,

           

          i have some problem in getting the selected row in scrollableDataTable.

           

          <rich:scrollableDataTable value="#{seamtablebean.userList}" var="user" id="list" binding="#{seamtablebean.dataUiData}" rows="5" height="100px" selection="#{seamtablebean.selection}" rowKeyVar="rkv" frozenColCount="1" sortMode="single">

           

          </rich:scrollableDataTable>

           

          This is my code i have written in XHTML file.

           

          and:

           

          private SimpleSelection selection = new SimpleSelection();

          HtmlScrollableDataTable dataUiData;

           

          i have proper setter and getter method for this.

           

                    userList = listofelements.getAlerts();
                      dataUiData.setSortMode("single");
                      dataUiData.setSelection(getSelection());
                      dataUiData.setValue(userList);
                      dataUiData.setHeight("100px");
                      dataUiData.setRows(5);

                      Iterator keys = dataUiData.getSelection().getKeys();
                     
                      while(keys.hasNext())
                      {
                      Object key = keys.next();
                      dataUiData.setRowKey(key);
                         }

           

          This code fills the table.

           

          Now i not getting selected row from the table. i always get null for

           

          Iterator iterator = getSelection().getKeys();

           

          so pls anybody suggest where am i going wrong.

           

          Thanks in advance

           

          Regards

          Devika.N

          • 17. Re: scrollableDataTable issues with selecting rows
            abcd1

            use this code

            where GR_KUN_7130 is the binding variable for scrollabledatatable

            HtmlScrollableDataTable GR_KUN_7130; which must be given in the binded attribute in xhtml code for table

             

            GR_KUN_7130_TableBean is the table bean

             

            Iterator iterator = getSelection().getKeys();
                        while (iterator.hasNext()) {
                            Integer key = (Integer) iterator.next();
                            GR_KUN_7130.setRowKey(key);
                            GR_KUN_7130_TableBean obj =(GR_KUN_7130_TableBean)GR_KUN_7130.getRowData();
                            int indx = GR_KUN_7130_List.indexOf(obj);
                            // idx is the selected row number
                           
                        }

            • 18. Re: scrollableDataTable issues with selecting rows
              ilya_shaikovsky

              check richfaces-demo sources. extended and scrollable table samples has this implemented. http://www.jboss.org/richfaces/demos.html

              1 2 Previous Next