0 Replies Latest reply on Sep 25, 2007 7:27 AM by jan.ziegler

    Dynamic region-parameter in A4J.AJAX.Submit() ?


      Dynamic region-parameter in A4J.AJAX.Submit()?

      At the moment I´m using different ajax regions (a4j:region) each containing an aj4:jsFunction (with a parameter).
      I use multiple regions because each region has its request parameters which shall be send independently to server side (decoding) on ajax submit.

      for example the function for "region1" is rendered as:

      function ajaxAction(myParam){A4J.AJAX.Submit('j_id5:region1',...

      All functions do the same thing (only the function parameter changes), so I wondered if it´s possible to use just a single jsFunction for all regions (would be less code),
      but without loosing the separation of request parameters per region.
      But therefore the first parameter (which is the region parameter I think) in A4J.AJAX.Submit() must be dynamic, like:

      function ajaxAction(myParam, myRegion){A4J.AJAX.Submit(myRegion,...

      Is it possible to achieve this bebavior?

      By the way I´m building all regions und functions (+ some component) on a programmatical way. I didn´t find any method on HtmlAjaxFunction which supports this.

      thx for any advice!