开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜