[richfaces-issues] [JBoss JIRA] (RF-13605) a4j:ajax button click event gets lost

Michal Petrov (JIRA) issues at jboss.org
Mon Apr 14 07:40:34 EDT 2014


    [ https://issues.jboss.org/browse/RF-13605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12961570#comment-12961570 ] 

Michal Petrov commented on RF-13605:
------------------------------------

Like [~avijra] said in the mail, I'm not sure this should be considered a bug. What happens is that the onblur triggers a rerender and so a part of DOM, button included, is replaced. The click on the original button either never happens to begin with, or is not executed since the button doesn't exist any more. Given that the ajax request may take a while to come back I assume the click might still register sometimes.

{code}
<body>
  <script type="text/javascript">
    refresh = function() {
      var html = $('<input type="text" onblur="console.log(\'a\'); refresh()">'
        + '<button onclick="console.log(\'b\'); return false">Click</button>');

      var form = $('#form');
      form.html(html);
    }
  </script>
  <form id="form">
    <input type="text" onblur="console.log('a'); refresh()">
    <button onclick="console.log('b'); return false">Click</button>
  </form>
</body>
{code}
As far as I understand this should do essentially the same thing, albeit without ajax. The click doesn't trigger either.
                
> a4j:ajax button click event gets lost
> -------------------------------------
>
>                 Key: RF-13605
>                 URL: https://issues.jboss.org/browse/RF-13605
>             Project: RichFaces
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: component-a4j-core
>    Affects Versions: 4.3.6
>            Reporter: abhishek vijra
>
> Clicking on the submit button of a form containing input elements with valuechange event listeners triggers only the execution of the event listeners of the corresponding input elements, but the button click event apparently gets lost and the form isn't actually being submitted. The user has to click on the button again to finally submit it. Explicitly setting the requestDelay of an associated a4j:queue to say 200ms for all events seems to preserve the click event and the form gets submitted as expected in our specific test environment. This isn't a generally acceptable workaround though, as it introduces redundant global delay and hardly preserves the click event reliably across environments with different timing constraints.
> Attached a testcase to isolate the problem, see the attached zip file containing a minimal JSF application with a simple RichFaces-enabled form which reproduces the undesired behavior.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the richfaces-issues mailing list