Uploaded image for project: 'RichFaces'
  1. RichFaces
  2. RF-13060

Issue in initializing the list of selected items in a Picklist

    Details

    • Sprint:
      RichFaces 4.3.4 Sprint 1
    • Steps to Reproduce:
      Hide

      The application is available in the forum issue. I could not find way to include it in this page.

      Show
      The application is available in the forum issue. I could not find way to include it in this page.
    • Workaround Description:
      Hide

      Make sure your domain objects implement both the euqals and the hashCode methods.

      Show
      Make sure your domain objects implement both the euqals and the hashCode methods.

      Description

      A picklist uses two list of items: a list of available items and a list of selected items. If this second list has to be initialized, it has to contain the same object instances as those in the available items. So both lists can't be built from two separate DB queries, since they would refer to distinct objects, and in this case, the list of selected items would always be empty. Upon request of Brian Leathem, I have created this JIRA issue after providing a sample application that illustrates the problem.

      /Items.xhtml is the frontend
      Item is the element to be displayed in the list
      ItemBean is the managed bean that builds the available and selected lists
      ItemConverter is the converter

      As you see in ItemBean's constructor, depending on the way I build the selectedList, it gets displayed properly or not

      the project is using ivy for dependencies, and is build using ant tasks
      ant resolve-dependencies
      ant package

      should build the war file in /dist

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                bleathem Brian Leathem
                Reporter:
                jn.colin Jean-Noel Colin
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 30 minutes
                  30m
                  Remaining:
                  Remaining Estimate - 30 minutes
                  30m
                  Logged:
                  Time Spent - Not Specified
                  Not Specified