开发者

How to use rich:effect with a4j:support and reRender

开发者 https://www.devze.com 2023-01-28 00:54 出处:网络
On my JSF-page, I\'m showing some content based on the value of a checkbox. How can I attach an effect (like fading in and out) when this content is re-rendered? Is there an event like onRender or som

On my JSF-page, I'm showing some content based on the value of a checkbox. How can I attach an effect (like fading in and out) when this content is re-rendered? Is there an event like onRender or something?

Here is what I got so far, but the effect is not showing:

<t:selectBooleanCheckbox title="Yes" label="Yes" value="#{myBean.booleanValue}">
   <a4j:support ajaxSingle="true" event="onchange" reRender="panel"/
</t:selectBooleanCheckbox>

<t:div id开发者_运维知识库="panel">
     <rich:effect name="hideDiv" for="myPanelGrid" type="Opacity" params="duration:0.8,from:1.0,to:0.1"/>
     <rich:effect name="showDiv" for="myPanelGrid" type="Opacity" params="duration:0.8,from:0.1,to:1.0"/>
   <t:panelGrid columns="2" rendered="#{myBean.booleanValue}" id="myPanelGrid">
...
...
...
   </t:panelGrid>
</t:div>


What you've forgotten is event property.

<rich:effect event="onmouseout" name="hideDiv" for="myPanelGrid" type="Opacity" params="duration:0.8,from:1.0,to:0.1"/>

Also you can show an effect with a js call if you like.

<rich:effect name="hideDiv" for="myPanelGrid" type="Opacity" params="duration:0.8,from:1.0,to:0.1"/>

<input type="button" onclick="hideDiv" value="Hide" />

More details can be found here, Richfaces-demo

0

精彩评论

暂无评论...
验证码 换一张
取 消