Perfect! Thank you!

2012/6/15 Martin Grigorov <mgrigo...@apache.org>

> either make 'sites' final or use Wicket events (
> http://www.wicket-library.com/wicket-examples/events/ )
>
> On Fri, Jun 15, 2012 at 12:42 PM, Dmitriy Neretin
> <dmitriy.nere...@googlemail.com> wrote:
> > Thanks! It was really helpful! But I am only to 99% ready :)
> >
> > There is a little problem in your code example:
> >
> > if I make so:
> > label.setDefaultModelObject(sites.getModelObject());
> >
> > I get a compiler error: "Cannot refer to a non-final variable sites
> inside
> > an inner class..." Is there any workaround for this?
> >
> > Thank you!
> >
> >
> > 2012/6/15 Martin Grigorov <mgrigo...@apache.org>
> >
> >> Something like:
> >>
> >> final Label label = ...
> >> RadioChoice<String> sites = new RadioChoice<String>("site", SITES);
> >>                sites.add(new AjaxFormChoiceComponentUpdatingBehavior()
> >>                {
> >>                        @Override
> >>                        protected void onUpdate(AjaxRequestTarget target)
> >>                        {
> >>
> >> label.setDefaultModelObject(sites.getModelObject());
> >>                                target.add(label);
> >>                        }
> >>                });
> >>
> >> On Fri, Jun 15, 2012 at 11:25 AM, Dmitriy Neretin
> >> <dmitriy.nere...@googlemail.com> wrote:
> >> > Thanks!
> >> >
> >> > Can you describe how can I use the
> >> AjaxFormChoiceComponentUpdatingBehavior()
> >> > with the label?
> >> >
> >> > 2012/6/15 Martin Grigorov <mgrigo...@apache.org>
> >> >
> >> >> Hi,
> >> >>
> >> >> #onSelectionChanged() works only if you override
> >> >> #wantOnSelectionChanged() to return true.
> >> >> Otherwise you can also use AjaxFormChoiceComponentUpdatingBehavior()
> >> >> and update the label with Ajax.
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> >> >> For additional commands, e-mail: users-h...@wicket.apache.org
> >> >>
> >> >>
> >>
> >>
> >>
> >> --
> >> Martin Grigorov
> >> jWeekend
> >> Training, Consulting, Development
> >> http://jWeekend.com
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> >> For additional commands, e-mail: users-h...@wicket.apache.org
> >>
> >>
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

Reply via email to