3

I have an application with requests which fetch lists from huge tables (7 mil+ records) that can take up to 10 seconds to complete.

Is there any way to have a cancel button to cancel the request instead of waiting for the previous request to finish. Currently, if the user tries clicking the cancel button (a page redirect), then it will throw a ConcurrentRequestTimeoutException.

I could increase this timeout, as it is now set to 500 ms, but then the user would have to wait for the previous request to complete. I want it to cancel the previous request and redirect immediately.

Is this possible?

Button code:

<s:button id="cancelEdit" value="Cancel" propagation="end"
  view="/reference/ProviderList.xhtml">
</s:button>

I also tried using h:commandButton and ending the conversation before-redirect in the page.xml file.

Mike
  • 358
  • 1
  • 2
  • 12

1 Answers1

0

Leave the conversation behind by putting an actionListener="#{conversation.leave}" attribute on your cancel button. If you have a add a propagation="none" attribute instead.

dcernahoschi
  • 14,968
  • 5
  • 37
  • 59
  • Sorry, I forgot to add these details. I have updated my post. But yes, I tried ending the conversation both with the button propagation above and ending in the page.xml before-redirect. I don't think it would matter that I'm using end instead of none, would it? – Mike Dec 08 '11 at 20:55
  • There is a big difference between ending(propagation=end) a conversation and leaving it(propagation=none). Ending merely makes a long running conversation a normal one (reuse the same conversation id). Leaving it leaves the conversation in the background and starts a new one. By the way, I've tested the propagation=none on your use case and works perfectly. Just ending the conversation doesn't solve the problem. – dcernahoschi Dec 09 '11 at 09:46