You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Nazaret Kazarian (Created) (JIRA)" <ji...@apache.org> on 2011/11/23 14:51:40 UTC

[jira] [Created] (WICKET-4257) Ajax indicator getting stuck when button is pressed multiple times

Ajax indicator getting stuck when button is pressed multiple times
------------------------------------------------------------------

                 Key: WICKET-4257
                 URL: https://issues.apache.org/jira/browse/WICKET-4257
             Project: Wicket
          Issue Type: Bug
    Affects Versions: 1.4.19
            Reporter: Nazaret Kazarian
            Priority: Minor


http://apache-wicket.1842946.n4.nabble.com/Ajax-busy-indicator-getting-stuck-td4082837.html

I have added a global ajax indicator to all my pages by having all 
pages (through a TemplatePage superclass) implement the 
IAjaxIndicatorAware interface. 

Generally it works, but I have noticed that it is quite easy to get 
the ajax indicator stuck spinning indefinitely, by issuing many ajax 
calls quickly the one after the other. For example if I press an ajax 
button multiple times quickly the busy indicator gets stuck. 
It seems as if the Wicket.show(hide)Incrementally js functions lose 
count of ajax requests and the busy indicator is never actually 
hidden.

With a little reverse engineering I noticed that maybe one of the 
cases this happens is this: an ajax button is pressed, 
showIncrementally is executed, but the actual ajax request is 
postponed because its channel is busy. When the time comes to actually 
execute the request, the request is stopped because of precondition 
check, and thus hideIncrementally is never called. This loses the 
count. A fix might be to call hideIncrementally when the ajax request 
precondition is not met. As to why the precondition is not met, I am 
guessing it's because the previous ajax request did DOM replacement in 
a way that the precondition of the queued request is no longer met. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (WICKET-4257) Ajax indicator getting stuck when button is pressed multiple times

Posted by "Nazaret Kazarian (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4257?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nazaret Kazarian updated WICKET-4257:
-------------------------------------

    Attachment: ajax-indicator.rar

Quickstart reproducing the problem.
                
> Ajax indicator getting stuck when button is pressed multiple times
> ------------------------------------------------------------------
>
>                 Key: WICKET-4257
>                 URL: https://issues.apache.org/jira/browse/WICKET-4257
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.4.19
>            Reporter: Nazaret Kazarian
>            Priority: Minor
>         Attachments: ajax-indicator.rar
>
>
> http://apache-wicket.1842946.n4.nabble.com/Ajax-busy-indicator-getting-stuck-td4082837.html
> I have added a global ajax indicator to all my pages by having all 
> pages (through a TemplatePage superclass) implement the 
> IAjaxIndicatorAware interface. 
> Generally it works, but I have noticed that it is quite easy to get 
> the ajax indicator stuck spinning indefinitely, by issuing many ajax 
> calls quickly the one after the other. For example if I press an ajax 
> button multiple times quickly the busy indicator gets stuck. 
> It seems as if the Wicket.show(hide)Incrementally js functions lose 
> count of ajax requests and the busy indicator is never actually 
> hidden.
> With a little reverse engineering I noticed that maybe one of the 
> cases this happens is this: an ajax button is pressed, 
> showIncrementally is executed, but the actual ajax request is 
> postponed because its channel is busy. When the time comes to actually 
> execute the request, the request is stopped because of precondition 
> check, and thus hideIncrementally is never called. This loses the 
> count. A fix might be to call hideIncrementally when the ajax request 
> precondition is not met. As to why the precondition is not met, I am 
> guessing it's because the previous ajax request did DOM replacement in 
> a way that the precondition of the queued request is no longer met. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (WICKET-4257) Ajax indicator getting stuck when button is pressed multiple times

Posted by "Martin Grigorov (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4257?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov resolved WICKET-4257.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.5.5
                   1.4.20
         Assignee: Martin Grigorov

Fixed.
Now if the precondition doesn't match and there is an indicator then it will be decremented.
                
> Ajax indicator getting stuck when button is pressed multiple times
> ------------------------------------------------------------------
>
>                 Key: WICKET-4257
>                 URL: https://issues.apache.org/jira/browse/WICKET-4257
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.4.19
>            Reporter: Nazaret Kazarian
>            Assignee: Martin Grigorov
>            Priority: Minor
>             Fix For: 1.4.20, 1.5.5
>
>         Attachments: ajax-indicator.rar
>
>
> http://apache-wicket.1842946.n4.nabble.com/Ajax-busy-indicator-getting-stuck-td4082837.html
> I have added a global ajax indicator to all my pages by having all 
> pages (through a TemplatePage superclass) implement the 
> IAjaxIndicatorAware interface. 
> Generally it works, but I have noticed that it is quite easy to get 
> the ajax indicator stuck spinning indefinitely, by issuing many ajax 
> calls quickly the one after the other. For example if I press an ajax 
> button multiple times quickly the busy indicator gets stuck. 
> It seems as if the Wicket.show(hide)Incrementally js functions lose 
> count of ajax requests and the busy indicator is never actually 
> hidden.
> With a little reverse engineering I noticed that maybe one of the 
> cases this happens is this: an ajax button is pressed, 
> showIncrementally is executed, but the actual ajax request is 
> postponed because its channel is busy. When the time comes to actually 
> execute the request, the request is stopped because of precondition 
> check, and thus hideIncrementally is never called. This loses the 
> count. A fix might be to call hideIncrementally when the ajax request 
> precondition is not met. As to why the precondition is not met, I am 
> guessing it's because the previous ajax request did DOM replacement in 
> a way that the precondition of the queued request is no longer met. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4257) Ajax indicator getting stuck when button is pressed multiple times

Posted by "Marc Nuri (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4257?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13189074#comment-13189074 ] 

Marc Nuri commented on WICKET-4257:
-----------------------------------

I have the same issue.
If an AjaxSubmitLink is pressed and the request is postponed the AjaxIndicator remains visible when the request is finally completed.
This only happens with AjaxSubmitLink.
                
> Ajax indicator getting stuck when button is pressed multiple times
> ------------------------------------------------------------------
>
>                 Key: WICKET-4257
>                 URL: https://issues.apache.org/jira/browse/WICKET-4257
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.4.19
>            Reporter: Nazaret Kazarian
>            Priority: Minor
>         Attachments: ajax-indicator.rar
>
>
> http://apache-wicket.1842946.n4.nabble.com/Ajax-busy-indicator-getting-stuck-td4082837.html
> I have added a global ajax indicator to all my pages by having all 
> pages (through a TemplatePage superclass) implement the 
> IAjaxIndicatorAware interface. 
> Generally it works, but I have noticed that it is quite easy to get 
> the ajax indicator stuck spinning indefinitely, by issuing many ajax 
> calls quickly the one after the other. For example if I press an ajax 
> button multiple times quickly the busy indicator gets stuck. 
> It seems as if the Wicket.show(hide)Incrementally js functions lose 
> count of ajax requests and the busy indicator is never actually 
> hidden.
> With a little reverse engineering I noticed that maybe one of the 
> cases this happens is this: an ajax button is pressed, 
> showIncrementally is executed, but the actual ajax request is 
> postponed because its channel is busy. When the time comes to actually 
> execute the request, the request is stopped because of precondition 
> check, and thus hideIncrementally is never called. This loses the 
> count. A fix might be to call hideIncrementally when the ajax request 
> precondition is not met. As to why the precondition is not met, I am 
> guessing it's because the previous ajax request did DOM replacement in 
> a way that the precondition of the queued request is no longer met. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4257) Ajax indicator getting stuck when button is pressed multiple times

Posted by "Marc Nuri (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4257?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13192940#comment-13192940 ] 

Marc Nuri commented on WICKET-4257:
-----------------------------------

I'm experiencing the problem 1.5.4 and 1.5.3 too.
                
> Ajax indicator getting stuck when button is pressed multiple times
> ------------------------------------------------------------------
>
>                 Key: WICKET-4257
>                 URL: https://issues.apache.org/jira/browse/WICKET-4257
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.4.19
>            Reporter: Nazaret Kazarian
>            Priority: Minor
>         Attachments: ajax-indicator.rar
>
>
> http://apache-wicket.1842946.n4.nabble.com/Ajax-busy-indicator-getting-stuck-td4082837.html
> I have added a global ajax indicator to all my pages by having all 
> pages (through a TemplatePage superclass) implement the 
> IAjaxIndicatorAware interface. 
> Generally it works, but I have noticed that it is quite easy to get 
> the ajax indicator stuck spinning indefinitely, by issuing many ajax 
> calls quickly the one after the other. For example if I press an ajax 
> button multiple times quickly the busy indicator gets stuck. 
> It seems as if the Wicket.show(hide)Incrementally js functions lose 
> count of ajax requests and the busy indicator is never actually 
> hidden.
> With a little reverse engineering I noticed that maybe one of the 
> cases this happens is this: an ajax button is pressed, 
> showIncrementally is executed, but the actual ajax request is 
> postponed because its channel is busy. When the time comes to actually 
> execute the request, the request is stopped because of precondition 
> check, and thus hideIncrementally is never called. This loses the 
> count. A fix might be to call hideIncrementally when the ajax request 
> precondition is not met. As to why the precondition is not met, I am 
> guessing it's because the previous ajax request did DOM replacement in 
> a way that the precondition of the queued request is no longer met. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4257) Ajax indicator getting stuck when button is pressed multiple times

Posted by "Marc Nuri (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4257?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13192947#comment-13192947 ] 

Marc Nuri commented on WICKET-4257:
-----------------------------------

The bug happens whenever the submitlink is double clicked, as a workaround you can override AjaxSubmitLink with the following code to temporarily disable onclick until the first event is totally processed:



                        @Override
                        protected IAjaxCallDecorator getAjaxCallDecorator() {
                            return new AjaxCallDecorator() {

                                @Override
                                public CharSequence decorateScript(Component c, CharSequence script) {
                                    return String.format(
                                            //Store the old function in onclick_ 
                                            "this.onclick_disabled=this.onclick;"
                                            //Substitute onclick function
                                            + " this.onclick=function() { return false; };%s", script);
                                }

                                @Override
                                public CharSequence decorateOnSuccessScript(Component c, CharSequence script) {
                                    return String.format(
                                            //Restore old function
                                            "if (typeof(this.onclick_disabled) != 'undefined') this.onclick=this.onclick_disabled;%s",
                                            script);
                                }

                                @Override
                                public CharSequence decorateOnFailureScript(Component c, CharSequence script) {
                                    return String.format(
                                            //Restore old function
                                            "if (typeof(this.onclick_disabled) != 'undefined') this.onclick=this.onclick_disabled;%s",
                                            script);
                                }
                            };
                        }
                
> Ajax indicator getting stuck when button is pressed multiple times
> ------------------------------------------------------------------
>
>                 Key: WICKET-4257
>                 URL: https://issues.apache.org/jira/browse/WICKET-4257
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.4.19
>            Reporter: Nazaret Kazarian
>            Priority: Minor
>         Attachments: ajax-indicator.rar
>
>
> http://apache-wicket.1842946.n4.nabble.com/Ajax-busy-indicator-getting-stuck-td4082837.html
> I have added a global ajax indicator to all my pages by having all 
> pages (through a TemplatePage superclass) implement the 
> IAjaxIndicatorAware interface. 
> Generally it works, but I have noticed that it is quite easy to get 
> the ajax indicator stuck spinning indefinitely, by issuing many ajax 
> calls quickly the one after the other. For example if I press an ajax 
> button multiple times quickly the busy indicator gets stuck. 
> It seems as if the Wicket.show(hide)Incrementally js functions lose 
> count of ajax requests and the busy indicator is never actually 
> hidden.
> With a little reverse engineering I noticed that maybe one of the 
> cases this happens is this: an ajax button is pressed, 
> showIncrementally is executed, but the actual ajax request is 
> postponed because its channel is busy. When the time comes to actually 
> execute the request, the request is stopped because of precondition 
> check, and thus hideIncrementally is never called. This loses the 
> count. A fix might be to call hideIncrementally when the ajax request 
> precondition is not met. As to why the precondition is not met, I am 
> guessing it's because the previous ajax request did DOM replacement in 
> a way that the precondition of the queued request is no longer met. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira