AnsweredAssumed Answered

Problem with multiValueField and selectOneListbox

Question asked by lucjan on Jan 3, 2007
I try to build custom multi value selection with multiValueField and selectOneListbox components.
Below is part of my jsp:

<r:multiValueField id="multi-category-selector"
     value="#{TDAdvancedSearchBean.categories}"
     lastItemAdded="#{TDAdvancedSearchBean.addedCategory}"
     selectItemMsg="#{msg.select_category}"
     selectedItemsMsg="#{msg.selected_categories}"
     noSelectedItemsMsg="#{msg.no_selected_categories}"
     styleClass="selector">
     <h:selectOneListbox id="category-selector" value="#{TDAdvancedSearchBean.addedCategory}" size="1">
          <f:selectItems   value="#{TDAdvancedSearchBean.categoryList}"   />
     </h:selectOneListbox>
</r:multiValueField>

After pressing "Add to List" button nothing is added to selected values list.
I tried to debug UIMultiValueEditor and I've found that getSubmittedValue() in broadcast returns null so after
addedItem = childComponent.getSubmittedValue();
addedItem is null and in consequence nothing is added to the list of selected values.
What is the reason of this.

How can I use selectOneListbox which is populated with custom data together with multiValueField component.

Thanks.

Lucjan

Outcomes