[ 
https://issues.apache.org/jira/browse/WICKET-6750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17044272#comment-17044272
 ] 

Ernesto Reinaldo Barreiro commented on WICKET-6750:
---------------------------------------------------

Hi [~svenmeier],

Thanks for your comment. Yes this might is posible to achieve registering a 
listener and holding the  request object and then calling abort on it. I have 
no strong feelings about getting this applied. Provided patch needs still to be 
cleaned up but it seems to be doing its work. If patch doesn't gets applied, If 
considered interesting, I can still modify AJAX upload page to showcase how to 
cancel a download. By the way, cancelling download produces 

 

!image-2020-02-25-10-59-47-820.png!

On server side. Not sure if there is a generic way to generate handle this on

 

*protected void* onFileUploadException(*final* FileUploadException e,
 *final* Map<String, Object> model)

 

and anyway as AJAX request will fail and messages will not make it to client, 
anyway. I will complete patch and then it is up to you guys if this get merged 
or not.

> add capability to cancel ongoing AJAX requests from client side
> ---------------------------------------------------------------
>
>                 Key: WICKET-6750
>                 URL: https://issues.apache.org/jira/browse/WICKET-6750
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-core
>    Affects Versions: 8.7.0, 9.0.0-M4
>            Reporter: Ernesto Reinaldo Barreiro
>            Assignee: Ernesto Reinaldo Barreiro
>            Priority: Major
>             Fix For: 9.0.0-M5
>
>         Attachments: image-2020-02-24-14-35-26-176.png, 
> image-2020-02-25-10-59-47-820.png
>
>
> Currently it is not possible to stop an ongoing AJAX request form client 
> side. This would be nice to have, on a per channel basis, for use cases such 
> as:
> 1- user cancelling a long lasting AJAX upload or other not duration 
> predictable AJAX requests?
> 2- add some logic at client side killing long running AJAX requests under 
> certain conditions?
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to