2 Replies Latest reply on Sep 4, 2008 6:54 AM by Eugene Suzyumov

    [newbie] FadeOut after form validation

    Eugene Suzyumov Newbie

      Hello

      I have seen many examples of FadeOut effect with jQuery when the effect is called in a javascript of an onclick event.
      What I want is to display in some cases a text with fadeout effect after the form has been submited and validated by the server.

      For now, when the form is submited, if the form contains an error then I change a boolean value to true. This value is checked in a rendered attribute to display an error message. But I want this message to be displayed for few seconds then to dissapear.

      Could anybody help me with this? I think this should be trivial, but I couldnot find the right reading.

      Regards
      l

        • 1. Re: [newbie] FadeOut after form validation
          Nick Belaevski Master

          Hello,

          Look at rich:effect component.

          • 2. Re: [newbie] FadeOut after form validation
            Eugene Suzyumov Newbie

            Hello,

            thanks for your answer.

            But I still have a trouve with this. I see the effect only when the full page is refreshed (with a h:commandLink). But when I try to update a part of a page (with a4j:commandLink reRender="area") then I cannot see the effect. The text appear, but it does not dissapear.

            Here is my code below :


            <h:form>
             <t:div id="area">
             <rich:effect for="window" event="onload" type="Fade"
             params="targetId:'content:_idJsp4:contentDiv2',duration:3,from:1,to:0" />
            
             <t:div id="contentDiv2">
             <h:outputText value="Hello world ! " styleClass="revealError" />
             </t:div>
            
             <h:commandLink action="#{test.actionRefresh}"
             value="Click here for page refresh" />
            
             <a4j:commandLink reRender="area"
             action="#{test.actionRefresh}">
             <h:outputText value="Click here for partiel refresh" />
             </a4j:commandLink>
             </t:div>
            </h:form>
            



            The code of actionRefresh is :

             public String actionRefresh() {
             return null;
             }
            


            How can I use rich:effect with a4j:commandLink reRender="xxx" ?

            Thanks in advance for any help

            I also forgot to say that I use RichFaces 3.1.6...

            Best regards