Hi.

I've found the mistake I've made. The rendered attribute
#{registrationAction.showMultiCitySelection} is a backing bean, that
didn't saved the state. So when submitting the form, the selectOneMenu
element was not posted back, because rendered was false and so the
converter wasn't triggered.

Sometimes it's too simple...

regards,
Veit


Veit Guna schrieb:
> I'm using selectOneMenu to offer the user a city selection. Internally
> the city objects are value objects that will be added to the selectitem
> objects as value property. So every selectitem contains the "real" city
> object. I've added a custom converter, that should convert from and to
> these value objects directly.
> 
> <h:selectOneMenu id="city_selection" required="true"
> value="#{registrationAction.city}"
> rendered="#{registrationAction.showMultiCitySelection}">
> <f:selectItems value="#{citySelection}" />
> </h:selectOneMenu>
> 
> It works for "reading" the select items - they will be display in the
> selectbox. When I place a breakpoint in the getAsString method of the
> converter, it will be triggered. So the converter is used. But when I
> submit the page, there's no object added to the
> #{registrationAction.city} bean. It is null. The reason why, I think is
> that the getAsObject method of the converter isn't invoked! I tested it
> with a breakpoint in this method and it isn't triggered.
> 
> So my question: is the converter for the selectonemenu component not
> triggered for input values?! I tried to find "the way up" from the
> converter to the point where it is invoked. But I only found a call from
> getConvertedUISelectManyValue not for selectonevalue or something.

Reply via email to