2 Replies Latest reply on Oct 11, 2009 11:37 PM by mongkeh

    reRender a component

      Hi,

      I want to play a randomize quote using rich:effect appear and fade
      but i am get trouble when i tried to display a random quote.

      My question is, How to "reRender" outputText component when the fade effect is completed (fade)

      This is my code:

      <div class="billboard-home">
      
       <blockquote id="blockquote" style="display:none" cite="#">
       <span id="quote">“ <h:outputText id="quoteText" value="#{wiseWordList.quotes}" />.�</span><br /><br /><span id="author">—<h:outputText value="#{wiseWordHome.instance.author}" /></span>
       </blockquote>
      
       <rich:effect name="showDiv" for="blockquote" type="Appear" params="delay:1.8, duration:0.5"></rich:effect>
       <rich:effect name="hideDiv" for="blockquote" type="Fade" params="delay:8.0, duration:2.0"></rich:effect>
      
       <rich:effect for="window" event="onload" type="Appear" params="targetId:'blockquote',delay:1.8, duration:0.5" />
       <rich:effect for="window" event="onload" type="Fade" params="targetId:'blockquote',delay:7.0, duration:1.0" />
      
       <a4j:region>
       <h:form>
       <a4j:poll id="quotesPoll" interval="10000" enabled="true" oncomplete="hideDiv();showDiv();" ignoreDupResponses="true" eventsQueue="quotesQueue"></a4j:poll>
       </h:form>
       </a4j:region>
      
       </div>



      Many thanks.

        • 1. Re: reRender a component
          ilya_shaikovsky

          I think the sequence should be:

          1) h:outputText should be hidden on initial load and shown with an effect on onload.
          2) hide should be called on onsubmit of the polling request
          3) poll rerender should occurs (adding outputText hidden via css as initially)
          4) oncomplete should trigger effect which will show the outputText.

          • 2. Re: reRender a component

            Can you give me some example how to do this?
            Thanks.