This content has been marked as final.
Show 3 replies
-
1. Re: Richfaces limitation to display rich:effect programmatic
nbelaevski May 17, 2009 5:15 PM (in response to brian13)Hello Brian,
"event" can not be EL-expression.
If you use "name" attribute - rich:effect creates client-side function that you can cell to trigger the effect. Here is how you can use this:<a4j:poll id="poll" interval="5000" enabled="true" reRender="saTree, effectsScript"/> <script type="text/javascript">window.effects = new Array();</script> <a4j:outputPanel id="effectsScript"> <script type="text/javascript"> while (effects.length > 0) { var effectFunc = effects.shift(); effectFunc(); } </script> </a4j:outputPanel> <rich:tree style="width:300px" value="#{library.data}" var="item" nodeFace="#{item.type}" id="saTree"> <rich:treeNode id="artistNode" type="artist" iconLeaf="/images/tree/singer.gif" icon="/images/tree/singer.gif"> <h:outputText value="#{item.name}" /> <rich:effect id="clickEffect" event="onclick" type="Highlight" params="duration:0.8" /> <rich:effect id="evEff" for="artistNode" name="effects[effects.length]" rendered="#{true}" type="Highlight" params="duration:0.9" /> </rich:treeNode> </rich:tree> </h:form>
It simply puts effects into array and then call them using external script (located in "effectsScript" component). Note that "for" attribute is necessary when "name" is used. -
2. Re: Richfaces limitation to display rich:effect programmatic
nbelaevski May 17, 2009 5:34 PM (in response to brian13)Rerendering order can be unpredictable - https://jira.jboss.org/jira/browse/RF-7181, this should help:
<a4j:outputPanel id="effectsScript"> <script type="text/javascript"> setTimeout(function() { while (effects.length > 0) { var effectFunc = effects.shift(); effectFunc(); }}, 0); </script> </a4j:outputPanel>
-
3. Re: Richfaces limitation to display rich:effect programmatic
brian13 May 18, 2009 1:51 PM (in response to brian13)Hello Nick,
Many thanks for the Solution !! that works ...
Kind Regards,
-- Brian