3 Replies Latest reply on Jul 3, 2010 2:09 PM by Akaine Harga

    Combobox and selecting item by id

    Rafal Kowalski Newbie

      I have code like this:

      <rich:combobox value=#{bean.chosenItem}>
      <f:selectitems value="#{bean.items}"/>
      <rich:support event="onselect"/>

      and in bean:

      List getItems() {
      LinkedList result=new LinkedList()'
      for (Element el: getElements()) {
      result.add(el.id, el.name)
      return result;

      Code above is wrong because combobox component shows id, not label from SelectIItem.

      How can I use ComboBox to know which item was selected? I want know it even two or more items has the same name (by ID).