문제

I have a custom UIComponent, which renders ok when called directly from the base facelet template (I guess this makes it a direct child of UIComponentBodyTag). However, when it is called within a composite component, nothing happens. I get no exceptions, nothing. Everything else renders ok.

So while this works:

<h:body>
    <x:myUiComponent />
</h:body>

This doesn't work:

<h:body>
    <demo:uiComponentWrapper />
</h:body>

uiComponentWrapper.xhtml:

<cc:implementation>
    Before [<x:myUiComponent />] After
</cc:implementation>

It prints simply as Before [] After.

By my logic, this should work. What am I missing? Running Mojarra 2.0.2.

도움이 되었습니까?

해결책

It seems that UIComponent's encodeAll(...) is called when it is added to page normally. However, encodeBegin(...) is called instead, when component is being added as a child of a composite component. My component building was defined in encodeAll(...), which wasn't run when adding the component as a composite component child.

So it's just different in different contexts. For the reason, why it is so, see question about exactly that.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top