简体   繁体   中英

Wicket : How to refresh/redraw a wizard onSubmit?

I have a Wizard( org.apache.wicket.extensions.wizard.Wizard ) that has an AjaxButton as its Next Button.

I am performing a long running operation on onSubmit() method of next button. Before exiting from the method I am using ajaxTarget.appendJavascript(js) where ajaxTarget is AjaxRequestTarget and js is a JavaScript snippet that I want to be evaluated.

Now, as far as I know, this script won't get executed until `onSubmit()´ has returned and the response is send back to the browser.

How can I execute my JavaScript immediately without waiting for onSubmit to have finished?

Note: I am using Wicket-4

this script won't get executed until the wizard is redrawn/refreshed.

All appended JavaScript snippets are executed once the AjaxRequest has finished - the wizard itself does not need to be updated.

If you're executing a long running task from your Ajax request, the browser's Ajax request will eventually run into a timeout. You should move your long running task onto a separate thread.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM