3 Replies Latest reply on Mar 25, 2009 9:27 AM by Ilya Shaikovsky

    Bug in ajaxSupport when using long ids?!

    Steffen Grimm Newbie

      Hi,

      I discovered a weird behaviour when using ajaxSupport inside rich:datatable to make a row clickable:


      My ajax support looks like this (nested inside the table):

      <a4j:support event="onRowClick" immediate="true"
       action="#{myBean.viewobject}">
      <f:param name="id" value="#{dto.key}"/>
      <f:param name="version" value="#{dto.version}"/>
      </a4j:support>
      


      the dto.key is datatype long in the back end, example value would be:
      200000000000001924

      I also have commandlink nested in each row code:

      <h:commandLink action="#{MyBean.viewobject}"
       immediate="true">
      <f:param name="idAjax" value="#{dto.key}"/>
      <f:param name="version" value="#{dto.version}"/>
      <h:outputLabel value="#{dto.okey}" />
      </h:commandLink>
      


      When I now click the command link everything works fine, the correct id is transfered to the backend and the next page opens with the information of the selected entry.

      BUT: When I click on the row, so that the Ajax Event is triggered the wrong ID is transfered to the backend: instead of 200000000000001924 I get 200000000000001920.

      I already reviewed the rendered html code in the browser and the IDs are correct there. I inspected the request with firebug and the wrong ID is put in the request (so it can't be a problem with the backend)

      Could it be that there is a bug in the A4J JavaScript functions, that build up the request. I already tried with shorter values and then it worked. Seems this ID is to long.

      Can anyone confirm that? Is there a workarround?

      Thanks in advance.

      Regards Stevo

      Here is the generated code in HTML:

      for the rowclick (which does not work):
      onclick="A4J.AJAX.Submit('_viewRoot','id_place_search',event,{'similarityGroupingId':'id_place_search:ort_result_table:1:j_id82','parameters':{'id':200000000000001924,'id_place_search:ort_result_table:1:j_id82':'id_place_search:ort_result_table:1:j_id82','version':'6'} ,'actionUrl':'/dd/pages/sd/ortsang/place_search.xhtml'} )"
      


      for the link in the row (which works):

      onclick="if(typeof jsfcljs == 'function'){jsfcljs(document.forms['id_place_search'],'id_place_search:ort_result_table:1:j_id113,id_place_search:ort_result_table:1:j_id113,id,200000000000001924,version,6','');}return false"