0

I've been trying to create a composite component that outputs a facet.

header.xhtml

<composite:interface>
  <composite:attribute name="headerLabel"/>
</composite:interface>

<composite:implementation>
  <f:facet name="header">
    #{cc.attrs.headerLabel}
  </f:facet>
</composite:implementation>

I want to be able to do something of the sort:

<p:datatable>
  <app:header headerLabel="This is a test"/>
</p:datatable>

But nothing gets rendered. Is there a way to accomplish this? Thanks!

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
rion18
  • 1,211
  • 16
  • 22
  • 1
    Never tried this (odd requirement), but a tag file should theoretically work: http://stackoverflow.com/q/6822000 – BalusC May 24 '16 at 19:57

1 Answers1

0

Following on what @BalusC said (a million thanks!), using tag file worked. This was more than enough:

<ui:composition ...>
  <f:facet name="header">
    #{headerLabel}
  </f:facet>
  ...
</ui:composition>
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
rion18
  • 1,211
  • 16
  • 22