users@javaserverfaces.java.net

Re: Listboxes with data added via javascript

From: Mikael Andersson <mail.micke_at_gmail.com>
Date: Fri, 28 Mar 2008 12:45:07 +0000

Do you have a h:messages on your page?

You might be getting validation errors!
I think that JSF checks that the selected values are among the selectable
values. In your case that wouldn't be true because you add them on the
client side.
This is a bit of a guess though :)

If you are using RichFaces or another ajax framework, you could add the item
to the list via an ajax request and re-render the list box.

Cheers,
 Micke

On 28/03/2008, Arinté <arintejr_at_gmail.com> wrote:
>
> I have a jsf form that has some input boxes and a listbox. The user types
> info
> in the input boxes and clicks the add button and that info is added to the
> listbox via a javascript call. So, the problem I am having is how do I get
> that
> info back into my backing bean?
>
> I have this:
> <h:selectManyListbox id="lists" value="#{cork.mist}" immediate="true">
> <f:selectItems value="#{cork.list}"/>
> </h:selectManyListbox>
> but cork.mist is never called. BTW the list back usually starts off as
> empty...
>
> Thanks...
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_javaserverfaces.dev.java.net
> For additional commands, e-mail: users-help_at_javaserverfaces.dev.java.net
>
>