I’d like to know if it’s possible to compose my own component (or call it Widget, Object).
I mean, instead of (for example) using h:panelGroup and a h:outputLabel inside it, make my own h:panelMarkzzz, as a composition of panelGroup and outputLabel.
Is it possible on JSF?
Yes, it’s possible to create a composition of existing components like that.
Kickoff example:
/resources/foo/group.xhtml/test.xhtmlThe
/foofolder name is free to your taste and you can reference it in XML namespace ashttp://xmlns.jcp.org/jsf/composite/XXX. The XHTML filename is the tag name.That said, composite components have performance implications and they should only be used when the functional requirement is not achievable using a simple include or tagfile. In your specific case, you’d better use a tagfile instead. A composite component is only worthy when you actually need it for the
<cc:interface componentType="...">.See also:
http://xmlns.jcp.org/jsf/compositetag documentation