0
votes

I try to clear and hide a Textfield in Wicket, based on the ajax update of an AjaxCheckBox. SetVisible(false) works fine, but I can't empty the contents of that textField, neither by using clearInput() nor by setting the value on the ModelObject

Is there any clean way to submit this emptied value with the form without having to force the value in onSubmit()?

1
Show us some code please! It is not very clear what you are doing and why it doesn't work for you. - martin-g
You can use onevent target.appendJavascript("document.getElementById('" + textfield.getMarkupId() + "').value = '';"); - soorapadman

1 Answers

1
votes

You could clear the TextField-model in the ajax-update of the CheckBox and then add the TextField to the AjaxRequestTarget