views:

527

answers:

1

hello i've got this jsf code

        <f:view>
    <rich:page pageTitle="My Page" markupType="xhtml">
...
<rich:panel id="content">
            <a4j:include viewId="#{MyBacking.viewId}" />
        </rich:panel>

and after trying a number of different ways, I've still not managed to place the following correctly in my code:

<rich:effect for="window" event="onload"  type="BlindDown" params="targetId:'<different tags depending on where I place this tag>',duration:2.8" />

My aim is to have the changed element in the a4j:included part of the page change but with the effect in use. I've tried putting it in my included page, or just after the f:view and rich:page tags in the calling page but to no avail. The demo doesn't take includes into account so I'm a bit stuck. Thanks

+1  A: 

Just target the a panel inside the rich:panel: targetId:'contentPanel'

and then

<rich:panel ..>
    <h:panelGroup layout="block" id="contentPanel">
        <a4j:include viewId="#{MyBacking.viewId}">
           <ui:param name="targetIdParam" value="putYourTargetIdHere" />
        </a4j:include>
    <h:panelGroup>
</rich:panel>
Bozho
Thanks for the post but I don't fully understand your answer. If I put the rich:effect tag in the file which contains the include, above the first tag (which is <h:form id="nc">) then couldn't I use `targetId:'nc'` instead of `targetId:'#{targetIdParam}'`? And in this case wouldn't `putYourTargetIdHere` be "nc" too?
Mark Lewis
is the `rich:effect` part of the included content? Or outside of it.
Bozho
I've tried both - as the demo doesn't show use with a4j:include I don't know the best place to put it. Where would you say it needed to go?
Mark Lewis
I still don't understand what you need.
Bozho
If I have an index.jsp and an content.jsp, and the index.jsp has the `a4j:include` tag in it, and that, through the use of the bean, calls the inclusion of content.jsp, it's the very process of including that jsp (which contains a tabPanel) that I want the effect on. So when the include happens, the contents of content.jsp 'blinds down'. Would I thus put the `rich:Effect` in the index.jsp or the content.jsp and where in the file? Thanks for your persistence.
Mark Lewis
Bozho, which file do I put the `rich:effect` in?
Mark Lewis
the `index.jsp`..but it actually doesn't matter, since the target ID is fixed
Bozho
Thanks - using your code, that works when the window loads as per the effect `for="window" event="load"`, but when a button is hit which causes the contents of the panel to change to a different included jsp file, as the window hasn't reloaded, no effect takes place. how can I bind this effect to a change of the included content?
Mark Lewis