2 Replies Latest reply on Jul 16, 2008 8:12 AM by oterral

    ajaxSingle attribute for <a4j:support>

    oterral

      Hello,

      I've a problem with ajaxSingle attribute .

      In my .jsp file I've this :
      <h:selectOneMenu id="window"><a
      <f:selectItem itemLabel="300,150" itemValue="300,150"></f:selectItem>
      <f:selectItem itemLabel="300,300" itemValue="300,300"></f:selectItem>
      <a4j:support id="test" event="onchange" reRender="mappane" ajaxSingle="true"/>
      </h:selectOneMenu>

      All works fine but in the list of parameter of the ajax request , all other parameter (title,bbox, elevation) from the page appears and the parameter "window" appears 2 times, like this :

      AJAXREQUEST j_id_jsp_1260680181_0
      idDuForm idDuForm
      idDuForm:bbox -20037507.067161847,-20037507.067161847,20037507.067161847,20037507.067161847
      idDuForm:elevation 0
      idDuForm:test idDuForm:test
      idDuForm:title World map
      idDuForm:window 600,600
      idDuForm:window 600,600
      javax.faces.ViewState j_id15:j_id16

      I've understand the ajaxSingle attribute should send only the paramter from his component like this :

      AJAXREQUEST j_id_jsp_1260680181_0
      idDuForm idDuForm
      idDuForm:test idDuForm:test
      idDuForm:window 600,600
      javax.faces.ViewState j_id15:j_id16



      I'm right or wrong?



        • 1. Re: ajaxSingle attribute for <a4j:support>
          oterral

          Ok I've resolved my problem

          The javascript variable : options.single is never set by the server , so I've correct this in the class :

          AjaxRendererUtils.java l219

          // For input components in single mode or without form submit input
          // control )
          if (ajaxSingle && input) { // || action
          // TODO - inside form, put reference :
          // document.forms['form'].controls['control']
          options.put("control", JSReference.THIS);
          options.put("single", JSReference.TRUE);
          }

          I don't know if it's an issue or a architecture choice

          but If it's an issue I hope you'll commited soon this patch in the a4j trunk.
          I use :
          repository : http://anonsvn.jboss.org/repos/ajax4jsf/trunk/framework
          revison 323

          Bye guys

          • 2. Re: ajaxSingle attribute for <a4j:support>
            oterral

            I've found a better solution ::


            The ajaxSingle options is commented l220 AjaxRenderUtils :

            if (ajaxSingle) {
            options.put("single", JSReference.TRUE);
            }

            just commmented out these 3 lines to make tha options ajaxSingle available