Reputation: 322
I have two Wicket Ajax Update Behaviours on TextField and on AjaxButton.
textField.add(AjaxFormComponentUpdatingBehavior("onchange") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
onTextFieldUpdate();
}
});
ajaxButton = new AjaxButton("accept"){
@Override
protected void onSubmit(AjaxRequestTarget target, Form form) {
onAjaxSubmited();
}
});
I have 2 processes:
Upvotes: 1
Views: 440
Reputation: 17513
You can use AjaxRequestAttributes for both the AjaxFormComponentUpdatingBehavior and the AjaxButton. See http://wicketinaction.com/2012/07/wicket-6-javascript-improvements/.
My idea is:
I hope you followed me. See https://ci.apache.org/projects/wicket/guide/7.x/guide/ajax.html#ajax_5 for more info.
Upvotes: 1
Reputation: 270
If I am understanding correctly then all you want is to conditionally execute the code what ever you are doing inside text field onchange. Or you could set some flag inside onchange and use it to control things inside button submit.
Just my opinion; trying to prevent change behavior on button click seems confusing. From design perspective, it seems that control flow needs to be before you do anything with the textfield.
Upvotes: 0