Disable input text in wicket
java, wicket
Solution
Add an behavior to the query textfields that listens to onChange event. In the `onEvent` method disable the address textfield and add it to the ajax request target.
See this example how to add the behavior and how to disable the other component. Keep in mind that you might add some checks if the other component has to be enabled or disabled.
queryTextField.add(new AjaxEventBehavior("onKeyUp") {
@Override
protected void onEvent(AjaxRequestTarget target) {
addressTextField.setEnabled(false);
target.add(addressTextField);
}
}
);
Problem
I have hml form with two input text ``` <input type="text" wicket:id = "query"/> <input type="text" wicket:id= "address"/> ``` I need to implement choose mechanism. When someone start to write query then address should be disable and vice versa.