I have a form where it has two elements: AjaxCheckbox and TextField. When the 
checkbox is un-checked, the TextField in browser should look blank. Here is the 
code I have:

final TextField input = new TextField("myinput") {
void onBeforeRender() {
super.onBeforeRender();
if ("certain way to get model and check is myproperty and if it is not true")
this.clearInput();
}
}
};
AjaxCheckBox box = new AjaxCheckBox("mycheckbox",
new PropertyModel(model, "myproperty")) {
@Override
protected void onUpdate(AjaxRequestTarget target) {
if (target != null) {
target.addComponent(input);
}
}
};

However, when I uncheck the checkbox, this.clearInput() in TextField is called, 
but the in the browser, the text field value in the browser is always there.

Spent sometime and unable to find a way to solve this issue. In javascript, 
this task is so easy. I must have missed something.

Can somebody show me how to clear the TextField value in the browser?

Thanks!


      

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to