Forum Discussion

M_McDonald's avatar
M_McDonald
Super Contributor
15 years ago

Abort request from RequestListener event

HI -

I want to listen for a request, then if certain values are included, present a dialog confirming that the request should be sent. Is there a way to abort a request from the RequestListener.filterRequest?

Thanks.

5 Replies

  • Hi,

    hmm.. there is no obvious way in the API, what if you just throw an Exception?

    regards,

    /Ole
    eviware.com
  • Hi,

    ok.. could you maybe use the SubmitFilter.beforeSubmit event instead? It allows you to return false if the submit should be aborted..

    regards!

    /Ole
    eviware.com
  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    A little closer. If I return false from the SubmitFilter.beforeSubmit event, the submit never occurs, but the request step never completes one way or another. I have to stop it from the GUI.
  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    Ah, it was simple. I just need to have submit.cancel() in the event and the step completes.

    Thanks.