webtier@glassfish.java.net

Re: Programmatic or dynamic construction of composite components

From: <webtier_at_javadesktop.org>
Date: Sun, 28 Feb 2010 13:55:30 PST

The first problem is that com.sun.faces.facelets.tag.jsf.CompositeComponentTagHandler is a public class with a "friendly" constructor. This effectively means that it can't be subclassed since this constructor is never visible to me (outside the com.sun.faces.facelets.tag.jsf package).

I thought allright, let's copy-paste. I copied the code and made the constructor public.
Next problem was that the original CompositeComponentTagHandler implements the CreateComponentDelegate interface and passes it to the tagHandlerDelegate:

((ComponentTagHandlerDelegateImpl)this.getTagHandlerDelegate()).setCreateCompositeComponentDelegate(this);

The problem is that CreateComponentDelegate is a "friendly" interface. So I can't pass an instance of "my" copy-pasted CompositeComponentTagHandler to the TagHandlerDelegate since:
* I can't implement this interface, it's not visible to me.
* The target setCreateCompositeComponentDelegate is also "friendly", so I can't call it.
[Message sent by forum member 'lexi' (valikov_at_gmx.net)]

http://forums.java.net/jive/thread.jspa?messageID=389249