Hi, The problem is that AjaxLink doesn't send the new value to the server. You need either AjaxCheckBox or CheckBox with AjaxFormComponentUpdatingBehavior, or AjaxButton that will submit the whole form.
On Sun, Jun 17, 2012 at 4:28 PM, xe0nre <[email protected]> wrote: > Hi , > > I have problem getting the value from a check box. > I have something like this: > > check = new CheckBox("check", Model.of(Boolean.TRUE)); > add(check); > > AjaxLink link = new AjaxLink("link") > { > @Override > public void onClick(AjaxRequestTarget target) > { > Boolean x = check.getModelObject(); > System.out.println(x); > } > }; > add(link); > > The problem is that the check.getModelObject() returns true even if the > checkbox is unchecked. > I have tried adding check.modelChanged() method. Nothing changed. > > Any suggestions ?Thx > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Wicket-checkbox-problem-tp4650022.html > Sent from the Users forum mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
