webtier@glassfish.java.net

Re: [webtier] SelectManyListbox validate error

From: Jim Driscoll <Jim.Driscoll_at_Sun.COM>
Date: Fri, 12 Jun 2009 10:57:25 -0700

On 6/11/09 8:24 PM, webtier_at_javadesktop.org wrote:
> I am moving an application from struts to jsf1.2, on jboss 4.2.2 i.e. the Mojarra implementation. I have 2 listboxes in a form with different lists in each. I use javascript to move entries from one listbox to the other before submitting the form. If the list returned on the one listbox contains entries that weren't in the original list provided to that listbox as SelectItem, then jsf throws a validation error.
>
> After looking through the api for UISelectMany and the jsf1.2 spec section 4.1.15.3 it seems that SelectMany will only allow you to return values that were in the original list.

Yes, that's the case. There's a way to do this in JSF 2, which I've
blogged, but that won't be final for a few months still.

Offhand, the only way I think you could do this in JSF 1.2 would be to
develop a custom component - or use an existing component library that
already does this. I know Trinidad has this, and I think Richfaces does
too.

JSF is a component based architecture. If you're rolling your own
components, you're doing extra work when you probably don't have to.

Jim