3

I want to create a composite component which adds some common meta data to views, like:

<viewController:metadata controller="orderController"/> 

the component:

<composite:interface> <composite:attribute name="controller" /> </composite:interface> <composite:implementation> <f:metadata> <f:viewParam name="id" value="#{cc.attrs.controller.id}" /> <f:event type="preRenderView" listener="#{cc.attrs.controller.initConversation}" /> </f:metadata> </composite:implementation> 

i do similar things to add a button bar to all views and it works fine, but it seems its not possible with f:metadata.

Am i right or is there something wrong with my code?

thanks

1 Answer 1

4

This isn't possible. The <f:metadata> has to go in the view associated with the view ID. See also the tag documentation (emphasis mine):

Declare the metadata facet for this view. This must be a child of the <f:view>. This tag must reside within the top level XHTML file for the given viewId, or in a template client, but not in a template. The implementation must insure that the direct child of the facet is a UIPanel, even if there is only one child of the facet. The implementation must set the id of the UIPanel to be the value of the UIViewRoot.METADATA_FACET_NAME symbolic constant.

Sign up to request clarification or add additional context in comments.

1 Comment

Hi @BalusC. I'm looking for something like that too. Is there another way to achieve this kind of component?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.