-
1. Re: combine the effects appear and fade to turn one image in
sergeysmirnov Oct 28, 2007 6:40 PM (in response to amoun)What you already tried to do and what were the problems?
-
2. Re: combine the effects appear and fade to turn one image in
amoun Oct 28, 2007 6:59 PM (in response to amoun)Well, first problem is that the effect is not executed after rerendering is called by a4j:poll. I tried to add rich:effect as a child element to the h:graphicImage element with onchange as the event - but nothing happened.
second, after trying to come up with a simple onclick change just one of the effects were executed (fade), but not the other one. -
3. Re: combine the effects appear and fade to turn one image in
sergeysmirnov Oct 28, 2007 7:52 PM (in response to amoun)post the code snippet of what you try to have.
-
4. Re: combine the effects appear and fade to turn one image in
amoun Oct 28, 2007 8:14 PM (in response to amoun)I have tried a couple of things without success. The last test version is the following:
<f:view> <a4j:form> <h:graphicImage id="bgHigh_1" url="../images/background/1000750_1lo.png" styleClass="backgroundHigh" style="z-index:3;filter:alpha(opacity=0);-moz-opacity:0;opacity:0;" /> <h:graphicImage id="bgHigh_2" url="../images/background/1000750_2lo.png" styleClass="backgroundHigh" style="z-index:4"> <rich:effect event="onchange" for="bgHigh_1" type="Appear" /> <rich:effect event="onchange" for="bgHigh_2" type="Fade" /> </h:graphicImage> <h:graphicImage id="bgLow_1" url="../images/background/1000750_1ru.png" styleClass="backgroundLow" style="z-index:1;filter:alpha(opacity=0);-moz-opacity:0;opacity:0;" /> <h:graphicImage id="bgLow_2" url="../images/background/1000750_2ru.png" styleClass="backgroundLow" style="z-index:2"> <rich:effect event="onchange" for="bgLow_1" type="Appear" /> <rich:effect event="onchange" for="bgLow_2" type="Fade" /> </h:graphicImage> <a4j:poll interval="5000" actionListener="#{Background.newBackground}" reRender="bgHigh_2,bgLow_2" /> </a4j:form> </f:view>
-
5. Re: combine the effects appear and fade to turn one image in
sergeysmirnov Oct 28, 2007 8:32 PM (in response to amoun)There is no reason to make effect as a child of h:graphic Image as soon as you have a 'for' attribute (i.e. the attaching performs on the client side)
Effect is applied on the DOM element in the browser. When you re-render something (remove old element and add the new one), the effect is gone with old element.
If I were you I use the 'name' attribute for the rich:effect and apply the effect by invoking the effect from the oncomplete of the a4j:poll -
6. Re: combine the effects appear and fade to turn one image in
amoun Oct 29, 2007 6:36 AM (in response to amoun)This was exactly the kind of help I was looking for. Now it works smoothly without any troubles.
Thank you very much for your help SergeySmirnov. -
7. Re: combine the effects appear and fade to turn one image in
mores Dec 12, 2007 11:07 AM (in response to amoun)Can you post the completed working solution to the Cookbook ?
http://labs.jboss.com/wiki/RichFacesCookbook -
8. Re: combine the effects appear and fade to turn one image in
mores Dec 17, 2007 1:36 PM (in response to amoun)I added a working example to:
http://labs.jboss.com/auth/wiki/en/CreateABannerUsingEffectsAndPoll
This one works fine with images.
Next I'll try and get one working with rich:panel