Hi,
calling b.setOutputMarkupId(true) during Ajax request is too late. The
HTML tag will not have a markup id, so nothing will be updated.
Call this method immediately after constructing the checkbox.
Regards
Sven
On 08/23/2010 09:18 PM, Anna Simbirtsev wrote:
Hi,
I am trying to use AjaxCheckBox to update another checkbox model object when
this checkbox is clicked.
CheckBox b = new CheckBox("basicCreate",
new Model<Boolean>());
AjaxCheckBox a = new AjaxCheckBox("create",
new Model<Boolean>()) {
private static final long serialVersionUID =
288634742710645609L;
protected void onUpdate(AjaxRequestTarget target)
{
if (getModelObject()) {
b.setModelObject(true);
b.setOutputMarkupId(true);
target.addComponent(b);
}
}
};
So when checkbox a is checked, I want checkbox b to be checked as well.
But nothing happens. Am I doing something wrong?
Thanks,
Anna
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org