javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-2483

programatically added ajax event listener is never invoked

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Works as designed
    • Affects Version/s: 2.2.0-m04
    • Fix Version/s: None
    • Component/s: ajax
    • Labels:
      None
    • Environment:

      glassfish 3.1.2

      Description

      HtmlCommandButton b=..

      AjaxBehavior ajax=...
      ajax.addAjaxBehaviorListener(listener);
      b.addClientBehavior("click", ajax);

      The listener is never called.

        Activity

        Hide
        jasonzhang2002gmailcom added a comment -

        change :b.addClientBehavior("click", ajax);
        to
        b.addClientBehavior("action", ajax);

        Still no event listener is invoked.

        Show
        jasonzhang2002gmailcom added a comment - change :b.addClientBehavior("click", ajax); to b.addClientBehavior("action", ajax); Still no event listener is invoked.
        Hide
        jasonzhang2002gmailcom added a comment -

        Not just ajax listener. ActionListened added to Button itself is not called, either.

        Show
        jasonzhang2002gmailcom added a comment - Not just ajax listener. ActionListened added to Button itself is not called, either.
        Hide
        jasonzhang2002gmailcom added a comment -

        Found the issue
        I have to set the execute the ajax to include @this. Otherwise, the button will not be invoked.

        List<String> exs=new LinkedList<String>();
        exs.add("@this");
        ajax.setExecute(exs);

        Show
        jasonzhang2002gmailcom added a comment - Found the issue I have to set the execute the ajax to include @this. Otherwise, the button will not be invoked. List<String> exs=new LinkedList<String>(); exs.add("@this"); ajax.setExecute(exs);
        Hide
        jasonzhang2002gmailcom added a comment -

        This issue can be closed.

        Show
        jasonzhang2002gmailcom added a comment - This issue can be closed.
        Hide
        rogerk added a comment -

        per comments.

        Show
        rogerk added a comment - per comments.

          People

          • Assignee:
            rogerk
            Reporter:
            jasonzhang2002gmailcom
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: