myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Kienenberger <>
Subject Re: composite controls
Date Thu, 28 Jul 2005 18:14:36 GMT
There are three ways to do this that I have successfully used.

#1)  Programmically create a set of controls as a new component.

#2)  Use x:aliasBean and a jsp include to represent your composite control.

#3)  Use ui:composition with the facelets library.

#1 is the hardest, most involved, and most fragile way to do it.

#2 is easy and requires only a dependency on x:aliasBean.   There are
possibly some issues with nesting x:aliasBean controls, however.

#3 is also easy and requires a dependency on the facelets library.

The resulting code for #2 and #3 are very similar, and converting
between them is trivial in most cases.

Shale's Clay subproject probably also offers similar functionality,
but I haven't used it yet.

You can find an example of #1 in issue MYFACES-331:

An example of using #2 (without the custom component code) would look like this:

            <x:aliasBean alias="#{backingBean}"
        				<jsp:include page="/pages/BooleanRelationshipDataTable.jsp"/>

An example of use #3 (without the custom component code) would look like this:

            <ui:include src="/pages/BooleanRelationshipDataTable.xhtml">
                <ui:param name="backingBean"


On 7/28/05, Dennis Byrne <> wrote:
> I can't seem to find a lot of resources on creating composite
> controls ( an .ascx in .NET speak ).  Does anyone have a web
> site or a war story for this?
> Dennis Byrne

View raw message