2 Replies Latest reply on Feb 4, 2011 3:52 AM by Didier Schonne

    Richfaces 4 M5 : need to click 2 times for an Ajax action

    Didier Schonne Newbie

      Hi everybody,

       

      I have a strange behavior with ajax calls. I have implemented this calls 3 different times :

       

      The first two (a4j:commandLink and h:commandLink with a4j:ajax) have the same behaviour : on my first click a http post is well sent but my backing bean is not called. On the next clicks, my backing bean is well called.

       

      The third way (h:commandLink with f:ajax), my backing bean is never called.

       

      <h:form>
          <div>
              Information 1 : <span class="donnes_small_regular" style="float:right;">#{InfoServlet.infoDTO.info1}</span>
          </div>
          <div>
              Information 2 :
              <span class="donnes_small_regular" style="float:right;">
                     <h:outputText value="#{InfoServlet.infoDTO.info2}">
                      <f:convertDateTime pattern="dd/MM/yyyy" type="date" />
                  </h:outputText>
              </span>
          </div>
          <div>
              Information 3 :
              <span class="donnes_small_regular" style="float:right;">
                     <h:selectOneMenu value="#{InfoServlet.infoDTO.info3}">
                         <f:selectItems value="#{SpecServlet.specInfos}" />
                     </h:selectOneMenu>
              </span>
          </div>
          <div class="submit">
              <a4j:commandLink action="#{InfoServlet.saveInfoDTO}" render="autreChose" execute="@form">
                  <h:graphicImage value="/images/icone_valider.png" />
              </a4j:commandLink>
      
              <h:commandLink action="#{InfoServlet.saveInfoDTO}">
                  <a4j:ajax render="autreChose" execute="@form" />
                  <h:graphicImage value="/images/icone_valider.png" />
              </h:commandLink>
      
              <h:commandLink action="#{InfoServlet.saveInfoDTO}">
                  <f:ajax render=":autreChoseForm:autreChose" event="click" execute="@form" />
                  <h:graphicImage value="/images/icone_loupe.png" />
              </h:commandLink>
          </div>
      </h:form>
      

       

      The first two manners send not the same post between the first post and the nexts :

       

      First :

       

      AJAX:EVENTS_COUNT    1
      j_idt112    j_idt112
      j_idt112:j_idt121    REFUSED
      j_idt112:j_idt124    j_idt112:j_idt124
      javax.faces.partial.ajax    true
      javax.faces.partial.event    click
      javax.faces.partial.execu...    j_idt112:j_idt124 @component
      javax.faces.partial.rende...    @component
      javax.faces.source    j_idt112:j_idt124
      org.richfaces.ajax.compon...    j_idt112:j_idt124
      

       

      Nexts :

       

      AJAX:EVENTS_COUNT    1
      j_idt112    j_idt112
      j_idt112:j_idt121    REFUSED
      j_idt112:j_idt124    j_idt112:j_idt124
      javax.faces.ViewState    H4sIAAAAAAAAAM1ZXWwURRyfu14/KV/9gJIKGikNJPSuH0CP1g9a2tKGK9ReWwQSz7m76d1e93aXmbnrHcYKD2jEmGjUGGKJGInywJM8qyE8mJBQAgkvGhNifDAaDSEaib44s7u3H/QKvWMbb5tM53ZnZv+//+dvZi//DsoVgsH6BExDb4oKoncYkvgoVMorv796bcOrt8qAewjUiDKMDsEIlfEIqKZxjEhcFqMZ5cV9gF/ts1Ws5f1WCiqVxBiUkJjCoP54QF1YhFLMezicQBHa+97Cy5+uIztENwAZhc0oV9iVOgHmQBn/NYeBl8/JeKdhBBFvRE4qsoQk6p0c2Z/rt4xhWUGYZg+iLAH6VccWxGCN+cJBKZW0PlQoqIGUYiGcoogw1PUm6j6MYTYgEJo5fXvzue/g+TLgGgEeIpxEqpRlsx7eskmt+aULUkjRMFMKwkGYRvjo9SvPfzB/Y9QN3AFQHREhIYdgElFQp6rExyX0BZkwUqw3AGoImxNV16BggzZCkH1BhAUoCidhWES9GUVJczUBwttahmYLe72XpCRdGN6KiBJv39hYYGRwQB/HZN69xEAhqYjeATQNUyId0m629CmKmJ2QZ5D016WdR+f3JfbVct3NtoGtPgXGEPExPxDSkAqy5IukCB2QI4NRgXozcZoUAXC1/SbS7kyGGXJ3YYYcw3xZZDUZR1BJQYNptok4pH0YBZn4/GENG+hWbePW4ao6qtF/8LaOG74yERKitGuv6Wh2t+OdKmPFnLXNRdZZF8wplv9rmO0E23XFcG3ISYTVziRBeEpAs0eEaAzZtdOVUYFtXAIBb5vzA+jwrwCAZ0GTz7AO8cURZE5sE7itCIEbmbHofs0/SI/uKMQQ2GMBwjJFw/E8qaLp23+DP8/8cD2XKlzGHHcagx1W70Jp7lljGI0jiUlvONgg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CH93Teaw7Sq05DuHbU0UUvYXFpFTe1tXNAdr90qbjAWK5SQgL76KBJl2yFyE83iNvnd06jy+09wz6zxeRb6neOSPjjoTWLXulIuwPTqgJk08Z4xdR76TF4cy9c1Cwz2nwu6VV2Gtmd+L1+J8TuB8pyd2JZbNYdC21FEup3rjsrz0By2+SiWzGOOudCRqP4gdkSiKIVz304WLf59+y+/mX6z0g1gbDTyUSoYRfvPyR5tXfXj3ndxh+mpD6QWckbhecDYRNYYZn28zNeJc8fuKrb5JVXtIVXtIlDW2HRoe7Bt4JE5Goj1pWYjaSH0xoaBXyXbQuvjLmdnlPmCrljsLrZYG6Ku6RZd7qJonjJ7UorVmaXEmAS8omf8A+lqEhqYeAAA=
      javax.faces.partial.ajax    true
      javax.faces.partial.event    click
      javax.faces.partial.execu...    j_idt112:j_idt124 @component
      javax.faces.partial.rende...    @component
      javax.faces.source    j_idt112:j_idt124
      org.richfaces.ajax.compon...    j_idt112:j_idt124
      

       

      As you can see there is a javax.faces.ViewState on the next clicks.

       

      Did I miss something or there is a bug ?

       

      Thank you in advance for your help.