2 Replies Latest reply on May 5, 2008 12:31 PM by mbinna

    Getting the selection from a ScrollableDataTable

    mbinna Newbie

      Is it possible to outject the selection from a RichFaces' ScrollableDataTable as an object in the context? I don't want to deal with a row number or such things. I want to select a row in the Table and when that row is selected a component in the context should be updated.

      I already tried the following in my session bean:

      private List<Item> itemList
      private Item selectedItem

      But when I print out some of the properties of selectedItem, the same values are printed out, no matter which item is selected.

        • 1. Re: Getting the selection from a ScrollableDataTable
          Andy Gibson Novice

          If you change it from the scrollableDataTable to a regular data table, does the selection work?  If not, can you post the relevant pieces of code?


          Andy Gibson

          • 2. Re: Getting the selection from a ScrollableDataTable
            mbinna Newbie

            Ok, finally I got it working using a h:dataTable and using the annotation DataModel and DataModelSelection. I think the problem was that the action was not triggered in the column but by a button global to all columns of the table.

            I'm relatively new to J2EE and Seam, so it might be possible to get that working too if one as enough experience. If someone has good advice, please let me know. ;-)

            Code from Manager.java:

            private List<Item> itemList;
            private Entity selectedItem;

            Code from list.xhtml:

            <h:dataTable value="#{itemList}" var="item">
                <h:commandLink value="#{item.description}" action="#{manager.edit}"/>

            Manuel Binna