Uploaded image for project: 'MyFaces Trinidad'
  1. MyFaces Trinidad
  2. TRINIDAD-2097

tr:selectOneListBox - item not selected - wrong item of selected item returned by SimpleSelectOneRenderer.resolveIndex

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 1.2.14-core
    • 1.2.15-core
    • Components
    • None

    Description

      I am setting value in selectOneListBox programmatically - CoreSelectOneListbox.setValue(...) but the item is not rendered as selected. Equals() method finds the object in combo that should be selected but method SimpleSelectOneRenderer._findIndex() returns wrong index. I have SelectItemGroups with SelectItems and the structure is following:

      Group 1 - empty
      Group 2

      • item 2.1
      • item 2.2 - should be selected
        Group 3 - empty
        Group 4 - empty
        Group 5 - empty

      Method _findIndex() returns 2. When option "item 2.2" is rendered its index is 1 and it is rendered as an option that is not selected.

      Even when I do not set value of combo programmatically and leave it up to component (setting value attribute), wrong item is preselected. When I use h:selectOneListBox, everything works fine - correct item is selected.

      Attachments

        1. TRINIDAD-2097.patch
          3 kB
          Michal Padera

        Activity

          People

            darkarena Scott O'Bryan
            padera Michal Padera
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: