开发者

Interrupt a JSF Ajax request

开发者 https://www.devze.com 2023-01-02 17:37 出处:网络
I have a JSF application, in which a RichFaces modal panel is shown using a4j:status while an ajax request is being handled by my backing bean.I 开发者_StackOverflowwant to put a cancel button on the

I have a JSF application, in which a RichFaces modal panel is shown using a4j:status while an ajax request is being handled by my backing bean. I 开发者_StackOverflowwant to put a cancel button on the modal panel so a user can interrupt the request.

What is the best way to do this? I'm thinking of something like having the cancel a4j:commandButton call an action on the bean to run FacesContext.getCurrentInstance().renderResponse() but not sure that's wise.

Thanks


One way is that the executing method in the managed bean [i.e on server side] which is in progress during your ajax call must be written in a way that it could be aborted so that it just returns thus ending the request.This would also maintain proper server side state.

0

精彩评论

暂无评论...
验证码 换一张
取 消