0 Replies Latest reply on Mar 14, 2011 12:14 PM by Edson Alves Pereira

    Updating a field every time a ajax request is called

    Edson Alves Pereira Newbie

      Hello folks, i´d like to update a hidden field to 1 every time a ajax request is called in my page and set the same field with 0 when its completed.

       

      Something like this:

       

      <h:form>

       

       

              <a4j:support reRender="hdnAjaxRequestActive#{name}"

                  onsubmit="document.getElementById( '#{name}Form:hdnAjaxRequestActive#{name}' ).value = 'true';"

                  oncomplete="document.getElementById( '#{name}Form:hdnAjaxRequestActive#{name}' ).value = 'false';" />

       

              <h:inputHidden id="hdnAjaxRequestActive#{name}" value=""/>

      </h:form>

       

      My problem here is with that approach, no ajax is processed at all! What should i do?

       

      PS: i doing this to create a kind of waitForAjax method in my selenium tests!

       

       

       

      Regards,

      Edson