ICEfaces
  1. ICEfaces
  2. ICE-9510

ace:selectMenu - not showing the selected item if the list contains one item

    Details

    • Assignee Priority:
      P1
    • Salesforce Case Reference:
    • Workaround Exists:
      Yes
    • Workaround Description:
      Hide
      Adding in a blank item so that there are more than 1 item in the list/selectItems will allow it to be shown as selected. For example:

                      <ace:selectMenu id="workaroundMenu"
                                      value="#{testBean.singleValue}"
                                      label="One Item:"
                                      labelPosition="left">
                          <f:selectItem itemLabel="First Item" itemValue="1"/>
                          <f:selectItem itemLabel="" itemValue="" itemDisabled="true"/>
                      </ace:selectMenu>
      Show
      Adding in a blank item so that there are more than 1 item in the list/selectItems will allow it to be shown as selected. For example:                 <ace:selectMenu id="workaroundMenu"                                 value="#{testBean.singleValue}"                                 label="One Item:"                                 labelPosition="left">                     <f:selectItem itemLabel="First Item" itemValue="1"/>                     <f:selectItem itemLabel="" itemValue="" itemDisabled="true"/>                 </ace:selectMenu>

      Description

      If an ace:selectMenu is displayed with only one item in the list and this item is pre-selected on the server side, the item isn't displayed as selected in the field.

      This isn't an issue if the backing list has many items.

        Activity

        Hide
        Arturo Zambrano added a comment -

        Committed fix to trunk at revision 37416 and to p01 tag at revision 37417.

        Fixed off-by-one error when going through the list of options for matching them against the set value.

        Show
        Arturo Zambrano added a comment - Committed fix to trunk at revision 37416 and to p01 tag at revision 37417. Fixed off-by-one error when going through the list of options for matching them against the set value.
        Hide
        Arran Mccullough added a comment -

        Attached test case source code and war file (ICEfaces jar feels need to be re-added to run).

        Show
        Arran Mccullough added a comment - Attached test case source code and war file (ICEfaces jar feels need to be re-added to run).

          People

          • Assignee:
            Arturo Zambrano
            Reporter:
            Arran Mccullough
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: