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

    Delay ajax request from rich toolTip

    Nicolas U. Newbie

      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.