I have to migrate a composite-component to a custom-component. This example is rather simplified, but demonstrates the problem: the childs of my component (my:test
) need to be rendered in another component. The composite my:testC
, as an example which I don't want to use, would look like this
<composite:implementation>
<p:panel>
<composite:insertChildren/>
</p:panel>
</composite:implementation>
Obviously (at least I hope I'm correct with this assumption) I can not simply render the p:panel
in encodeBegin
.
@FacesComponent("test")
public class Test extends UIPanel
{
@Override
public void encodeBegin(FacesContext context) throws IOException
{
// ??
}
@Override
public void encodeEnd(FacesContext context) throws IOException
{
// ??
}
}
I want to use my:test
in a way like this:
<my:test>
<h:outputText value="some Text"/>
</my:test>
The output should be the same than using my:testC
: some Text rendered in a PrimeFaces panel. How can I encode the usage of p:panel
in my Java class?
<p:panel>
in your custom component? Or are you concretely asking how to reuse the default encoder (renderer) of<p:panel>
for that part? The children is not the problem at all asencodeChildren()
does it all automatically, howerver the last sentence of the first paragraph seems to indicate otherwise, which is confusing. – Recallp:panel
. – Partizan