Accepting value in selectManyMenu

Could anyone help me accept value in selectManyMenu? I need to know how'll I design bean property to accept multiple values.
[132 byte] By [islandhopea] at [2007-11-27 5:13:15]
# 1
String Array.CowKing
IamCowKinga at 2007-7-12 10:34:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Or a List.
BalusCa at 2007-7-12 10:34:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

I am dealing with the same thing now, but selectManyListbox.

I have tried both array and list but in both cases only the last selected value is passed on.

Do you have an idea where the problem might be?

The setter already gets just one value.

JSP:

<h:selectManyListbox id="name" size="7" styleClass="listbox"

title="select one option" value="#{MyBean.selectedTaxons}">

<f:selectItems value="#{MyBean.taxons}"/>

</h:selectManyListbox>

MyBean.java:

protected List<String> selectedTaxons;

public void setSelectedTaxons(List<String> taxons) {

selectedTaxons = taxons;

}

honzaa at 2007-7-12 10:34:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
The taxons variable is a List<SelectItem>. So I have changed the previously posted code to List<SelectItem> now. But still the same results.
honzaa at 2007-7-12 10:34:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5

Finally, I have found the reason. This was very difficult.

As I mentioned above, I had been getting only last selected item of the selectmanylistbox.

The problem was in the JSP page. Here is a code sample (shortened):

<h:form id="form1">

<fieldset>

<h:panelGroup>

<h:selectManyListbox id="name" size="7" styleClass="listbox"

title="select one option"

value="#{BaseWorker.querySpectrum.selectedTaxons}">

<f:selectItems value="#{search.taxons}"/>

</h:selectManyListbox>

<h:panelGroup styleClass="queryDataGroup">

<ui:upload binding="#{search.fileUpload1}" id="fileUpload1"

styleClass="fileUpload1"

uploadedFile="#{BaseWorker.querySpectrum.uploadedFile}"/>

<h:inputTextarea id="textArea1" styleClass="textArea1"

value="#{BaseWorker.querySpectrum.uploadedText}"/>

</h:panelGroup>

</h:panelGroup>

<ui:button action="#{search.searchButton_action}"

binding="#{search.searchButton}" id="searchButton"

styleClass="button searchButton" text="#{bnlGeneral.search}"/>

</fieldset>

</h:form>

I have been removing the controls one by one and the problem was in <ui:upload ... />. The whole page works well without that tag.

But why? Is it not possible to mix h: and ui:? (But the button is from ui:, too and there is no problem.)

honzaa at 2007-7-12 10:34:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...