2 Replies Latest reply on Oct 25, 2009 5:31 PM by nimo stephan

    need javascript represantation of a4j 'ajax call'

    nimo stephan Master

      Hello,

      I want to invoke a javascript-function which makes a richfaces-ajax-call:



      For example, the code for doing a typical ajax-call in jsf:


      <h:inputText id="myInputText" value="">
      <a4j:support event="onchange" value="Call Method" action="#{myBean.setValues('hello World', 'good by')}" reRender="myRegion" limitToList="true" ajaxSingle="true" ignoreDupResponses="true"/>
      </h:inputText>


      returns this java-script-code (firebug tells me that):
      A4J.AJAX.Submit('_viewRoot',null,event,{'parameters':{'ajaxSingle':'myInputText','j_id24':'j_id24'} ,'actionUrl':'/mySite/welcome.com','similarityGroupingId':'j_id24','control':this,'implicitEventsQueue':'j_id24','ignoreDupResponses':true} )



      How can I invoke a A4J.AJAX-Call within a Java-Script function ?

      This does not work:

      function doAjaxCall() {
      
       A4J.AJAX.Submit('_viewRoot',null,event,{'parameters':{'ajaxSingle':'myInputText','j_id24':'j_id24'} ,'actionUrl':'/mySite/welcome.com','similarityGroupingId':'j_id24','control':this,'implicitEventsQueue':'j_id24','ignoreDupResponses':true} )
      }


      I want, that when I invoke the javascript-function 'doAjaxCall', then it should trigger the same as I would have when using a4j:support.
      (That means, the java-script function should trigger the action 'myBean.setValues('hello World', 'good by')' with help of A4J.AJAX.xx)

      How can I do that?