views:

132

answers:

1

Hello

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 want 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

+1  A: 

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.

daedlus
@scot thanks - so if I bind another method to the cancel which in the bean has power to interrupt the processing would that be the best way?
Mark Lewis
yes i think so.
daedlus