The problem is that we don't store eventhandlers as explicit state in
Wicket components.
This would add more memory consumption to make this capable.
And what would you do with:
form.add(new AjaxSubmitLink("opslaan") {
@Override
public void onSubmit() {...}
}
).onSubmit(function));
Which one should we call? Also, AjaxSubmitLink is abstract, to use
your example we would have to make it concrete, and need to implement
onSubmit with empty behavior.
While possible, this would mean a (big) departure that the API for
Wicket should be self-explanatory.
Martijn
On Mon, Nov 14, 2016 at 10:32 PM, Rob Audenaerde
<[email protected]> wrote:
> Just a wild idea, if the AjaxSubmitLink supports chaining in the onSubmit
> (return this instead of void) , it could become:
>
> form.add(new AjaxSubmitLink
> ("opslaan").onSubmit(function).onError(function);
>
> Very readable imho.
--
Become a Wicket expert, learn from the best: http://wicketinaction.com