Consider a simple composite component which takes an action parameter of some sort - a simple link 'prettifier', for example. I want to 'ajaxify' it.
<composite:interface>
<composite:attribute name="act" method-signature="java.lang.String action()"></composite:attribute>
<composite:attribute name="text" required="true"></composite:attribute>
<composite:clientBehavior name="click" event="action" targets="l"/> </composite:interface>
<composite:implementation>
<h:commandLink id="l" act="#{cc.attrs.action}" immediate="true"> <b>#{cc.attrs.text}</b> </h:commandLink> </composite:implementation>
I expose an event through client behaviour. I use it like this:
<h:panelGroup layout="block" id="outside">
#{mybean.otherdata} <br/>
<mc:mylink text="Click click" action="#{mybean.click}" >
<f:ajax event="click" render="outside"/>"
</mc:mylink><br/>
</h:panelGroup>
You can see what I want to do: I want to do an ajax render outside the composite definition; just setting render to "outside" gives the dreaded <f:ajax> contains an unknown id
error.
Yes, I am aware of naming containers, and I know we can prepend with a colon and specify an absolute path, but that's quite clunky. If I wrap it up in several more layers (which is the whole point) I'd have to chain these references together manually.
Can I make some sort of relative reference like render="../outside"
to skip the reference to the parent container of the component?
I did a jsf 1 app with a4j, and this pattern was used all over the place.