wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Swaroop Belur" <swaroop.be...@gmail.com>
Subject Re: Formless DropDownChoice selected value is null
Date Sun, 23 Sep 2007 09:32:06 GMT
You should use ajaxformcomponentupdatingbehavior instead of
AjaxEventBehavior . I think AjaxEventBehavior just triggers the server
side call and does not update model

-swaroop


On 9/23/07, bebetu <anotherflo@yahoo.com> wrote:
>
>
> Hi,
> I have a DropDownChoice in a WizardStep component (Wicket 1.3 beta 3) and
> I
> want to read the selected value then update a text label based on
> selection
> as well as disable the "Next" button if the user hasn't made a selection.
> First of all I cannot get the selected value when I run the code below,
> the
> selectedChoice variable is always null.
> Secondly, how to ajaxify the "Next" wizard button based on the selection?
> What am I doing wrong?
>
> final ValueMap choiceMap = new ValueMap();
> final PropertyModel ddcModel = new PropertyModel(choiceMap,
> "selectedOption");
> final DropDownChoice ddChoice = new DropDownChoice("choiceId", ddcModel,
> someOptionList);
> ddChoice.add(new AjaxEventBehavior("onchange") {
>                                @Override
>                    protected void onEvent(AjaxRequestTarget target) {
>                           Object selectedChoice =
> choiceMap.get("selectedOption");
>
>                    }
> });
>
> Thanks!
> florin
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message