views:

71

answers:

1

Hi,

I have a UIComponent that is binded to a backing bean. I'd like to add a child to the component that corresponds to the ui:include tag, through my backing bean's init method.

for example:

<p:tab>
    <ui:include src="/page.xhtml" />
</p:tab>

I want to create this in my backing bean like:

<p:tab binding="${bean.tab}" /> 

So basicly i'm looking for the corresponding UIComponent class for the ui:include, so i can add this as a child to my tab property.

Thanks!

UPDATE:

I'm now trying with faceletContext.includeFacelet :)

UPDATE2:

Ok, it's working :) Get the faceletContext from facescontext:

FaceletContext faceletContext = (FaceletContext) FacesContext.getCurrentInstance().getAttributes().get(FaceletContext.FACELET_CONTEXT_KEY);
A: 

I have added the answer to my question's post:)

Michael Bavin