AjaxFormComponentUpdatingBehavior not working in Wicket 8

aditsu quit because SE is EVIL :

I'm switching from Wicket 6 to Wicket 8, and AjaxFormComponentUpdatingBehavior doesn't seem to work anymore.

Example page:

    public HomePage() {
        final Form<Void> form = new Form<>("form");
        final TextField<String> txt = new TextField<>("txt", new Model<>());
        txt.add(new AjaxFormComponentUpdatingBehavior("onchange") {
            private static final long serialVersionUID = 1L;

            @Override
            protected void onUpdate(final AjaxRequestTarget target) {
                System.out.println("update: " + txt.getValue());
            }
        });
        form.add(txt);
        add(form);
    }

and corresponding html:

<form wicket:id="form">
<input wicket:id="txt">
</form>

In Wicket 8.5.0, the onUpdate method never gets called, and there is no error message. In Wicket 6 it works fine. The same thing happens with other component types, e.g. select/DropDownChoice.

Is this a bug? Or what am I doing wrong?

Jeroen Steenbeeke :

The events prefixed with on have been deprecated since Wicket 6. In Wicket 8, support for them has been removed. You can get these components to work again by changing onchange to change.

See also: https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+8.0

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=127931&siteId=1