I didn't mention anything about a value change listener.

You have
  value="#{editProfileAction.updateUserLocations}"
which I think is the cause of your problem.

And I didn't say it was complaining *about* the component id. I'm saying it is complaining about the component which has an id of "userLocations". You appear to have interpreted this as a problem with the *method* getUserLocations which I don't think is the case.

Regards,

Simon

monkeyden wrote:
Is the valueChangeListener supposed to return a String?  I was under the
impression that it's supposed to return void, like
ValueChangeListener.processValueChange(ValueChangeEvent event).

Why would it be complaining about the component id?

I wasn't quite clear enough in my description.  This particular select box
is expected to contain, and to submit, several items, so the mutator
(setter) will also take an array.  It's a Collection, owned by a user.


Simon Kitching-3 wrote:
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