7 Replies Latest reply on Aug 6, 2010 2:52 PM by Lotfi Mellouk

    Delay on the first ajax request

    Lotfi Mellouk Master

      Hi all,

       

      the question concerns an a4j:support request on comboBox select event, using the phase logger, the ajax request seems  normal, but the a4j status start faces   remaind enable for more than 4seconds.

       

      xhtml code:

       

      <a4j:form>
                  <a4j:status >
                      <f:facet name="start">
                          <h:graphicImage value="/images/loading2.gif" />
                      </f:facet>
                      <f:facet name="stop">
                          
                      </f:facet>
                  </a4j:status>
      </a4j:form>

       

      <rich:comboBox selectFirstOnUpdate="false" defaultLabel="Enter some value" value="#{bean.compagny}"
      id="combo_company" width="200" immediate="true">
      <f:selectItem itemLabel="All" itemValue="all" />
      <t:selectItems value="#{managerr.allCompanies}" var="list"
          itemLabel="#{list.name}" itemValue="#{list.name}" />
      <a4j:support event="onselect" reRender="users"
          action="#{bean.onSelectCompany}" ajaxSingle="true" />
      </rich:comboBox>

       

      and the phaselistener log

       

      INFO  2010-07-29 11:12:59,357 - BEFORE RESTORE_VIEW(1) 
      INFO  2010-07-29 11:12:59,373 - AFTER RESTORE_VIEW(1) 
      INFO  2010-07-29 11:12:59,388 - BEFORE APPLY_REQUEST_VALUES(2) 
      INFO  2010-07-29 11:12:59,388 - AFTER APPLY_REQUEST_VALUES(2) 
      INFO  2010-07-29 11:12:59,388 - BEFORE PROCESS_VALIDATIONS(3) 
      INFO  2010-07-29 11:12:59,388 - AFTER PROCESS_VALIDATIONS(3) 
      INFO  2010-07-29 11:12:59,388 - BEFORE UPDATE_MODEL_VALUES(4) 
      INFO  2010-07-29 11:12:59,388 - AFTER UPDATE_MODEL_VALUES(4) 
      INFO  2010-07-29 11:12:59,388 - BEFORE INVOKE_APPLICATION(5) 
      DEBUG  2010-07-29 11:12:59,388 - hibernate query
      INFO  2010-07-29 11:12:59,466 - AFTER INVOKE_APPLICATION(5) 
      INFO  2010-07-29 11:12:59,466 - BEFORE RENDER_RESPONSE(6) 
      INFO  2010-07-29 11:12:59,513 - AFTER RENDER_RESPONSE(6)

       

       

      Regards!

        • 1. Re: Delay on the first ajax request
          Lotfi Mellouk Master

          any updates.?

          thanks

          • 3. Re: Delay on the first ajax request
            Lotfi Mellouk Master

            don't see any error on a4j:log..

            • 4. Re: Delay on the first ajax request
              Ilya Shaikovsky Master

              I meant to check the client side processing time. There should be timing info on all the client side updates which occurs after responce came back.

              • 5. Re: Delay on the first ajax request
                Lotfi Mellouk Master

                Hi Ilya,

                 

                It seems that the update for the selectOneMenu  makes the request slow:

                 

                debug[15:47:55,386]: QueryString: AJAXREQUEST=_viewRoot&qf%3Acombo_companycomboboxField=ne&qf%3Acombo_company=Nexus%20Eurolink&qf%3Aclient=0&qf%3Ausers=60740&qf%3Aj_id170=&qf%3Aj_id172=&qf%3Aj_id174=&qf%3Aj_id176=&qf%3Aj_id178=&qf%3Aj_id180comboboxField=&qf%3Aj_id180=&qf%3Aj_id183=0&qf%3Aj_id189=&qf%3Aj_id191=&qf%3Aj_id193=&qf%3Aj_id195=&qf%3Aj_id197=&qf%3Aj_id199=&qf%3Aj_id201=&qf%3Aj_id203=&qf%3Aj_id205=&qf%3Avalidate=validate&qf_SUBMIT=1&javax.faces.ViewState=rO0ABXVyABNbTGphdmEubGFuZy5PYmplY3Q7kM5YnxBzKWwCAAB4cAAAAAN0AAVqX2lkOHB0AAwvcXVlcnkueGh0bWw%3D&ajaxSingle=qf%3Acombo_company&qf%3Aj_id158=qf%3Aj_id158&
                debug[15:47:55,387]: Request state : 1
                debug[15:47:58,532]: Request state : 2
                debug[15:47:58,533]: Request state : 3
                debug[15:47:58,533]: Request state : 4
                debug[15:47:58,533]: Request end with state 4
                debug[15:47:58,533]: Response with content-type: text/xml;charset=UTF-8
                debug[15:47:58,533]: Full response content: <html xmlns="http://www.w3.org/1999/xhtml"><head></head><body><span id="form_common:j_id99"><span><img src="/images/passed.gif" /></span><span></span></span><select id="qf:users" name="qf:users" size="1" style="width:200px;" onchange="A4J.AJAX.Submit('qf',event,{'similarityGroupingId':'qf:j_id167','parameters':{'qf:j_id167':'qf:j_id167'} } )"> <option value="0">All</option> <option value="53281">ddddwww</option> <option value="53231">xxxYYY </option><option value="53231">xxxYYY </option><option value="53231">xxxYYY </option></select><meta name="Ajax-Update-Ids" content="form_common:j_id99,qf:users" /><span id="ajax-view-state"><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="rO0ABXVyABNbTGphdmEubGFuZy5PYmplY3Q7kM5YnxBzKWwCAAB4cAAAAAN0AAVqX2lkOHB0AAwvcXVlcnkueGh0bWw=" /></span><meta id="Ajax-Response" name="Ajax-Response" content="true" /></body></html>
                • 6. Re: Delay on the first ajax request
                  Ilya Shaikovsky Master

                  The case looks really strange. JSF lifecycle execution takes less than second. Not sure about client side processing (you cut the bottom part where updates time listed). But the 3 sec consumed between the client started to get responce and finished it. So the problem could be even in some proxy or something like that.

                   

                  Seems we need example or more detailed environmental description. For now really can't reproduce :/

                  • 7. Re: Delay on the first ajax request
                    Lotfi Mellouk Master

                    yes I'll give you the entier exception, the problem occured only for the first ajax call ..