You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Jedadiah Ashford <je...@gmail.com> on 2009/07/15 15:07:11 UTC

How to access user form data (simple question)

Im new to Wicket and I have a simple problem. I have TWO list boxes. Using
javascript I need to move some choices from the first box to the second box,
which works fine, but how do I now see what the user has added to the second
box via an ajax submit button. Here is the declaration of the listbox, and
the submit button code. The list of choices is blank because I need that box
empty for the user, but even when I add things to the box, and hit the
button, the choices are still empty.

Any help would be very appreciated. Thanks everyone :)



ListMultipleChoice<String> throttleListMultiChosen =
*new*ListMultipleChoice<String>(
"chosenThrottles", *new* Model(), throttleListBlank);

*protected* *void* onSubmit(AjaxRequestTarget target, Form<?> form) {

target.addComponent(wmc2);
*List<String> listOfChosen = (List<String>)
throttleListMultiChosen.getChoices();     //This is coming out blank, no
items in the list, even when I add them.*


}

Re: How to access user form data (simple question)

Posted by Martin Makundi <ma...@koodaripalvelut.com>.
Are you trying to reinvent the Palette component?

http://wicketstuff.org/wicket13/compref?wicket:bookmarkablePage=:org.apache.wicket.examples.compref.PalettePage

**
Martin

2009/7/15 Jedadiah Ashford <je...@gmail.com>:
> Im new to Wicket and I have a simple problem. I have TWO list boxes. Using
> javascript I need to move some choices from the first box to the second box,
> which works fine, but how do I now see what the user has added to the second
> box via an ajax submit button. Here is the declaration of the listbox, and
> the submit button code. The list of choices is blank because I need that box
> empty for the user, but even when I add things to the box, and hit the
> button, the choices are still empty.
>
> Any help would be very appreciated. Thanks everyone :)
>
>
>
> ListMultipleChoice<String> throttleListMultiChosen =
> *new*ListMultipleChoice<String>(
> "chosenThrottles", *new* Model(), throttleListBlank);
>
> *protected* *void* onSubmit(AjaxRequestTarget target, Form<?> form) {
>
> target.addComponent(wmc2);
> *List<String> listOfChosen = (List<String>)
> throttleListMultiChosen.getChoices();     //This is coming out blank, no
> items in the list, even when I add them.*
>
>
> }
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org