How can i update a text field that is on a panel when a checkbox on a different panel is updated?
see the image

What I am trying to do is this:
AjaxCheckBox checkbox= new AjaxCheckBox("checkbox") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
boolean selected = getModelObject();
if(selected){
TextField textField = panel.getTextField();
textField.setModelObject(obj);
textField.add(new AttributeModifier("readonly", true,
new Model("readonly")));
}
}
};
Thanks
On the second panel (that contains the checkbox) you can add an abstract method
onUpdateCheckbox(AjaxRequestTarget target)that must be implemented by the first panel (that contains the text field).The
onUpdate(...)method of yourAjaxCheckBoxonly has to call this abstract method.On implementation of the
onUpdateCheckbox(...)at the first panel you can manipulate the textfield and add it to the target object.