update a textfield when clicking on a checkbox that lies in a different panel in Wicket
===

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

see the image

 ![image][1]


  [1]: http://i.stack.imgur.com/0vOqQ.png

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