6 Replies Latest reply on Aug 1, 2011 10:35 AM by elisei

    Delay ajax request from rich toolTip

    six-p4ck

      Hello all.

      I have a little question for a specific problem with a richfaces component.

      I have a overflow of sql request when i do this:



      i use this code:

      <rich:column>
       <f:facet name="header">
       <h:outputText value="#{messages['user.header.preview']}" />
       </f:facet>
       <a4j:mediaOutput element="img" rendered="#{_user.userImage != null ? 'true' : 'false'}" style="width:20px; height:20px;" mimeType="#{_user.userImage.contentType}" createContent="#{userPaint.paint}" value="#{_user.userImage.id}" cacheable="false">
       <f:param value="#{userList.timeStamp}" name="time" />
       <rich:toolTip showDelay="500" mode="ajax">
       <span style="white-space: nowrap">
       <a4j:mediaOutput element="img" rendered="#{_user.userImage != null ? 'true' : 'false'}" mimeType="#{_user.userImage.contentType}" createContent="#{userPaint.paint}" value="#{_user.userImage.id}" cacheable="false">
       <f:param value="#{userList.timeStamp}" name="time" />
       </a4j:mediaOutput>
       </span>
       </rich:toolTip>
       </a4j:mediaOutput>
       <h:graphicImage rendered="#{_user.userImage != null ? 'false' : 'true'}" style="width:20px; height:20px;" alt="no preview" url="/img/no_preview.gif" />
      </rich:column>
      


      I have delay for show the image, thats good but not for the ajax-request

      Then when i do fast up and down many time on the image list i have a lot of useless ajax request who generated SQL request.

      If i have a few user who make this in same time, my DB come very slow... too much request

      is it possible to make a delay for the ajax request? My delay work only for the show actually. And i can make a onclick because next step is show in a modal when you click on the picture

      thx all.

        • 1. Re: Delay ajax request from rich toolTip
          six-p4ck

          Preview i hpe work this time (no edit sux)


          • 2. Re: Delay ajax request from rich toolTip
            nbelaevski

            Hello,

            showDelay affects AJAX requests too. I see difference in behavior with showDelay="0" and showDelay="500". In fact, AJAX request is fired only when tooltip is first shown.

            • 3. Re: Delay ajax request from rich toolTip
              six-p4ck

              Ok it's another problem:

              when i add

              mode="ajax"


              delay stop working...

              Then this work fine, i have delay but page is slow because he preload all picture

              <rich:toolTip showDelay="2000">
               <span style="white-space: nowrap">
               <a4j:mediaOutput element="img" rendered="#{_annex.image != null ? 'true' : 'false'}" mimeType="#{_annex.image.contentType}" createContent="#{annexPaint.paint}" value="#{_annex.image.id}" cacheable="false">
               <f:param value="#{annexPaint.timeStamp}" name="time" />
               </a4j:mediaOutput>
               </span>
              </rich:toolTip>
              


              And the same with :
              <rich:toolTip showDelay="2000" mode="ajax">


              I have ajax request, the load of the page is faster, but i lose the delay for display the tooltip...

              Any idea?

              thx

              • 4. Re: Delay ajax request from rich toolTip
                nbelaevski

                showDelay works for me either with "ajax" (delaying request) or "client" modes. I've tried with RF 3.3.0.GA version.

                • 5. Re: Delay ajax request from rich toolTip
                  six-p4ck

                  Ok i have change the richfaces library from SEAM 2.1.1.GA who use richfaces 3.2.2.SR1 to 3.3.0GA and now it's work fine.

                  Thx

                  • 6. Re: Delay ajax request from rich toolTip
                    elisei

                    Hi,

                    Nick Belaevski schrieb:

                     

                    Hello,

                    showDelay affects AJAX requests too. I see difference in behavior with showDelay="0" and showDelay="500". In fact, AJAX request is fired only when tooltip is first shown.

                    in Richfaces4 the ajax request is sent instantly and the toolTip is showed only afterwards. How can i change this?

                     

                    Thanks.