1 Reply Latest reply on Mar 26, 2012 8:28 AM by danielguimaraes

    oncomplete in <a4j:support>

    danielguimaraes

      Hi,

       

       

      I'm using rich faces 3.3.3 in Weblogic 10.3.2 (Mojarra 1.2_10-b01-FCS) and have a problem with oncomplete attribute on a4j:support. The javascript method in attribute oncomplete isn't called when my method on actionListener call another managedbean:

      Example:

      <h:selectOneMenu id="idCombo" value="#{myMB.flag}" >

        <f:selectItems value="#{myMB.listFlags}"/>

                <a4j:support event="onchange" actionListener="#{myMB.test}" reRender="idCombo" onsubmit="if(!isOk()) return false;" oncomplete="continueSomething();" />

      </h:selectOneMenu>

       

       

      If the method in actionListener call another managedBean by "new", works fine (I mean, after finish the method java, the javascript method continueSomething() is called):

      public class myMB{

        public void test (ActionEvent event) {

          AnotherMB another = new AnotherMB();

          // DO SOMETHING

        }

      }

       

       

      But if the method in actionListener call another managedBean by "context.getApplication().getELResolver()", the javascript method in oncomplete is NOT called:

       

      import javax.el.ELResolver;

      import javax.faces.context.FacesContext;

      public class myMB{

        public void test (ActionEvent event) {

          FacesContext context = FacesContext.getCurrentInstance();

          ELResolver resolver = context.getApplication().getELResolver();

          AnotherMB another = (AnotherMB) resolver.getValue(context.getELContext(), null, "anotherMB");

          //DO SOMETHING

        }

      }

       

       

      I've already tried use the attribute "action" and change my java method to return "SUCCESS" but didn't work too.

      What's wrong?

       

       

      Thanks for help.

        • 1. Re: oncomplete in <a4j:support>
          danielguimaraes

          I found the error. My test (ActionEvent event) method which call another managedBean by "context.getApplication().getELResolver()" was doing a FacesContext.getCurrentInstance().responseComplete() in the end. I just delete this line and worked.

           

          Thanks.