2 Replies Latest reply on Dec 31, 2011 4:52 AM by mcmurdosound

    Richfaces 4.1: onsumit of form not called

    mhn

      The onsubmit attribute of my form is not called if I execute an ajax command in richfaces 4.1

       

      <h:form id="docform" onsubmit="alert('yippieh);">

          <a4j:commandButton

                onclick="if(!check(this)){return false;}"

                actionListener="#{MyController.do}"

                 execute="@this"

                 render="foo"

                  oncomplete="doit();"

            .../>

       

      This was working well with Richfaces 3.3.3.

       

      How can specify some JS functions that should be executed before any ajax call?

      I do not want to add it to a few hundred commands.

        • 1. Re: Richfaces 4.1: onsumit of form not called
          pvito

          Hi, Michael

           

          Use h:commandButton instead of a4j:commandButton

             

             <h:form onsubmit="alert('yippieh');">

                  <h:commandButton value="push me" actionListener="#{userBean.do1}"/>

              </h:form>

           

          Regards, Vitaliy

          • 2. Re: Richfaces 4.1: onsumit of form not called
            mcmurdosound

            I think this is not the right approach since he wants to 'capture' ajax calls and not just form submits.

             

            You should look into a4j:queue - the global queue should be sufficient. But I'm not sure if the clientside features are already working.