It looks to me like your method "editProfileAction.updateUserLocations" is not returning a string. The complaint about "userLocations" is referring to the component id, not a method name.

Value should be a binding to a property (ie get/set methods). When rendering, the getter is called and expects a value that matches the "value" property of one of the SelectItem objects from the f:selectItems child. When the user selects a different SelectItem from the list, the setter is called, passing the "value" of whatever SelectItem the user chose..

Regards,

Simon

monkeyden wrote:
I am getting a converter error when trying to pass an array of SelectItems to
a selectManyListbox.  Isn't this component designed to handle an array?  Why
would I need a converter?  Note, these are pre-selected items.  That's why
the value of the selectManyListbox is the same as <f:selectItems/>

JSF:
<h:selectManyListbox immediate="true" id="userLocations" value="#{editProfileAction.updateUserLocations}"
    size="11" styleClass="selectBox"
    valueChangeListener="#{editProfileAction.updateUserLocations}">
    <f:selectItems value="#{editProfileAction.userLocations}"/>
</h:selectManyListbox>


Java:
private SelectItem[] userLocations;
...
public SelectItem[] getUserLocations() {
    return userLocations;
}

public SelectItem[] getUserLocations() {
    return userLocations;
}
...
Result:
java.lang.IllegalArgumentException: Value is no String and component
alertsSubView:alertsForm:userLocations does not have a Converter
        at
org.apache.myfaces.renderkit.RendererUtils.getConvertedStringValue(RendererUtils.java:544)
        at


Reply via email to