-
1. Re: rich:effect onload hide a panel
ilya_shaikovsky Oct 1, 2007 7:26 AM (in response to lmgjohnson)why you just can't explore the demo sources? Is something not clear there?
-
2. Re: rich:effect onload hide a panel
lmgjohnson Oct 1, 2007 7:49 AM (in response to lmgjohnson)None of the examples are hidden when the page loads so there is no source to explore. The 'Show Source' link shows the demo source but it is hidden whe the page loads. This if the functionality I would like to know; how to have the rich:effect hide a panel when the page loads like you do with the demo source code.
-
3. Re: rich:effect onload hide a panel
maksimkaszynski Oct 1, 2007 8:35 AM (in response to lmgjohnson)Download demo source from SVN - and cut it asunder :)
-
4. Re: rich:effect onload hide a panel
sergeysmirnov Oct 1, 2007 12:55 PM (in response to lmgjohnson)It looks like I understand where you took the wrong code.
you need to have
<rich:effect for="window" event="onload" type="BlindUp" params="targetId:'bookingpanel'" />
i.e. targetId, not just id -
5. Re: rich:effect onload hide a panel
lmgjohnson Oct 1, 2007 1:05 PM (in response to lmgjohnson)SergeySmirnov thanks for your reply but the actual demo code is . . .
<rich:effect for="window" event="onload" type="Appear" params="id:'contentDiv',duration:0.8,from:0.3,to:1.0" />
-
6. Re: rich:effect onload hide a panel
sergeysmirnov Oct 1, 2007 1:08 PM (in response to lmgjohnson)yes. This is the place I told about.
-
7. Re: rich:effect onload hide a panel
lmgjohnson Oct 2, 2007 1:36 AM (in response to lmgjohnson)This is what I found in the SVN Source Code http://anonsvn.jboss.org/repos/richfaces/tags/3.1.0/samples/richfaces-demo/src/main/webapp/templates/include/sourceview.xhtml
<div> <a4j:outputPanel styleClass="viewsourcelooklink" id="look"> <rich:effect for="look" event="onclick" type="Fade" targetId="source1" params="duration:0.0" /> <rich:effect for="look" event="onclick" type="Fade" params="duration:0.1" /> <rich:effect for="look" event="onclick" type="BlindDown" targetId="source1" params="delay:0.1,duration:1.0,from:0.0,to:1.0" /> <rich:effect for="look" event="onclick" type="Appear" targetId="source1" params="delay:0.1,duration:0.5,from:0.0,to:1.0" /> <h:outputText escape="false" value="#{empty openlabel?'View Source' : openlabel }" /> </a4j:outputPanel> <rich:panel id="source1" bodyClass="viewsourcebody" headerClass="viewsourceheader" styleClass="viewsourcepanel" style="display:none"> <f:facet name="header"> <rich:spacer height="3px" /> </f:facet> <div class="viewsourcediv"> <rich:insert src="#{sourcepath}" highlight="#{empty sourcetype? 'xhtml' : sourcetype }"/> </div> <a4j:outputPanel id="hide" styleClass="viewsourcehidelink"> <rich:effect for="hide" event="onclick" type="BlindUp" targetId="source1" params="id:'source1', duration:1.0" /> <rich:effect for="hide" event="onclick" type="Appear" targetId="look" params="delay:1.0, duration:1.0" /> <h:outputText style="padding-right:5px" value="<<Hide Source"/> </a4j:outputPanel> </rich:panel> </div>
The most important bit for not displaying the panel when the page loads is really very simple style="display:none". Easy when you know how.
SergeySmirnov thank you for the link to your very informative RichFaces. Most Important Links (covers 3.1.0 release). I shall keep it in my favorites. -
8. Re: rich:effect onload hide a panel
sergeysmirnov Oct 5, 2007 12:50 PM (in response to lmgjohnson)AFAIK, the window onload code is invoked AFTER the page is loaded. So, you need to take care about the period of time between the DOM element is created and onload is invoked. Why it might be a surprise ?