tags:

views:

18

answers:

0

I have a composite component, where I pass in an arbitrary defined attribute:

<x:mycomp x="..."/>

x being defined as such in the interface definition of the cc. Inside the implementation of mycomp I have an event listener:

<composite:implementation>
    <f:event type="preRenderComponent" listener="#{mycontroller.init}" />
</composite:implementation>

Now I would like to do something on the backend with this arbitary parameter x. how do I pass it accross the system event, like with an f:attribute tag? or getting the source component from the event and trawling through its internals? (speaking of which where in the UIComponent are these attributes stored anyway - I couldn't find them, not in attributes anyway).

If not possible this severely limits the usefulness of system events. If you put the component inside a ui:repeat the listener is fired multiple times so it is walking through the tree during event firing.

Only thing I can think of is to encode the init directly into the render:

<composite:implementation>
    #{mycontroller.init(cc.attrs.x)} //returns empty string
    <!--f:event type="preRenderComponent" listener="#{mycontroller.init}" /-->
</composite:implementation>

But I thought thats what a prerender system event would be for.