You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Asgaut Mjølne <as...@bouvet.no> on 2008/10/16 17:32:50 UTC

How can I get hold of a palette's selected item?

Hi,

Is it possible to get hold of the value of a palette's selected item, when
it is clicked (not double clicked)?

The purpose is to view a description of each selected item in the palette:
When a user clicks whatever item in the palette, I want to get hold of this
item's value, then use it to retrieve a description from my DB, then show
this description in a text area right next to the palette.

The onSubmit function in the code below is executed when the user clicks an
item in the palette, but I have no clue how to get hold of either the
clicked item or the value of it.

myPalette.add(new AjaxFormSubmitBehavior(form, "onClick"){
                protected void onSubmit(AjaxRequestTarget target) {
                    //....retrieve value here, but how??
                }

            }); 


Thanks,


Asgaut Mjølne
-- 
View this message in context: http://www.nabble.com/How-can-I-get-hold-of-a-palette%27s-selected-item--tp20015714p20015714.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: How can I get hold of a palette's selected item?

Posted by Igor Vaynberg <ig...@gmail.com>.
you have to write code that will add your own onchange/onclick javascript
handler

-igor

On Thu, Oct 16, 2008 at 8:32 AM, Asgaut Mjølne <as...@bouvet.no>wrote:

>
> Hi,
>
> Is it possible to get hold of the value of a palette's selected item, when
> it is clicked (not double clicked)?
>
> The purpose is to view a description of each selected item in the palette:
> When a user clicks whatever item in the palette, I want to get hold of this
> item's value, then use it to retrieve a description from my DB, then show
> this description in a text area right next to the palette.
>
> The onSubmit function in the code below is executed when the user clicks an
> item in the palette, but I have no clue how to get hold of either the
> clicked item or the value of it.
>
> myPalette.add(new AjaxFormSubmitBehavior(form, "onClick"){
>                protected void onSubmit(AjaxRequestTarget target) {
>                    //....retrieve value here, but how??
>                }
>
>            });
>
>
> Thanks,
>
>
> Asgaut Mjølne
> --
> View this message in context:
> http://www.nabble.com/How-can-I-get-hold-of-a-palette%27s-selected-item--tp20015714p20015714.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>