简体   繁体   English

小票:如何在提交时刷新/重绘向导?

[英]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. 我有一个向导( org.apache.wicket.extensions.wizard.Wizard ),它具有一个AjaxButton作为其下一个按钮。

I am performing a long running operation on onSubmit() method of next button. 我正在对下一个按钮的onSubmit()方法执行长时间运行的操作。 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. 从该方法退出之前,我使用ajaxTarget.appendJavascript(js) ,其中ajaxTargetAjaxRequestTargetjs是我要评估的JavaScript代码段。

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. 现在,据我所知,直到返回“ onSubmit()”并将响应发送回浏览器,该脚本才会执行。

How can I execute my JavaScript immediately without waiting for onSubmit to have finished? 如何在不等待onSubmit完成的情况下立即执行我的JavaScript?

Note: I am using Wicket-4 注意:我正在使用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. AjaxRequest完成后,所有附加的JavaScript代码段都将执行-向导本身不需要更新。

If you're executing a long running task from your Ajax request, the browser's Ajax request will eventually run into a timeout. 如果您要通过Ajax请求执行长时间运行的任务,则浏览器的Ajax请求最终将超时。 You should move your long running task onto a separate thread. 您应该将长期运行的任务移到单独的线程上。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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