Hi,
On Tue, Oct 4, 2016 at 1:10 AM, sorinev <[email protected]> wrote:
> I'm in the middle of upgrading from 1.4.17 to 7.3 and one of many issues is
> with the AjaxButton class that we extended. We provided three constructors
> (id and form; id; id and model), an init function common to all three, and
> an override of getAjaxCallDecorator().
>
> Init function did a few
> add(JavascriptPackageResource.getHeaderContribution(new
> ResourceReference(OurAJaxButton.class, "filename.js")).
>
> The override for getAjaxCallDecorator had a new IAjaxCallDecorator as a
> parameter that had inplace overridesw for decorateScript,
> decorateOnFailureScript, and decorateOnSuccessScript.
>
> As near as I can tell, the replacement for the javascript stuff was
> JavaScriptHeaderItem.forUrl("filename.js").
>
> The replacement for the ajax decorator bit seems to have been
>
You can simplify this to:
.onInit("show();").onComplete("hide();"));
>
>
> The strings inside there correspond, to the three decorate functions above,
> except since they were actual method overrides, they did the js string +
> the
> paramater (a CharSequence).
>
>
> So that's all that was changed to get rid of the build errors. The actual
> usage of the button hasn't changed. We just do in-place overrides for
> onError(AjaxRequestTarget, Form) and onSubmit(AjaxRequestTarget, Form).
> Nothing here had to change. We also have defaultFormProcessing false
> because
> this is a cancel button. But for some reason, wicket prints the following
> messages to the log and the onSubmit(AjaxRequestTarget, Form) override is
> never entered.
>
>
>
> We neither call these methods directly, nor are they overridden, so I'm not
> sure what's going on here.
>
It seems somehow this AjaxButton is treated as normal (non-Ajax) Button.
Check for JavaScript errors.
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/Unexpected-Invocation-of-onSubmit-tp4675637.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>