jsr372-experts@javaserverfaces-spec-public.java.net

[jsr372-experts] Re: Improve vdl.createComponent(...) to use ui:include and user tags

From: arjan tijms <arjan.tijms_at_gmail.com>
Date: Wed, 29 Oct 2014 20:56:22 +0100

Hi,

On Wed, Oct 29, 2014 at 6:39 PM, Leonardo Uribe <leonardo.uribe_at_irian.at> wrote:
> just create one facelet and then attach that facelet in the component tree.
>
> [...]
>
> https://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-611
> Export FaceletFactory as a standard artifact vended from FactoryFinder.
> [...]
> It was mentioned that add FaceletFactory "as is" was too inconvenient.

Before diving into the main issue you addressed, just wanted to
quickly comment on this one.

The standard FaceletFactory would not only have been convenient to
programmatically create a Facelet, but also to get a hold of the
component tree before it's being state tracked and everything. This
could then allow one to programmatically add components without the
runtime knowing or caring that they were dynamically added. I.e. it
would be just like one "dynamically" creates components from within a
Facelet using c:if and friends.

At the moment none of the existing abstractions in JSF seem to be able
to offer this conveniently. ViewDeclarationLanguage#buildView comes
close, but does a little too much.

> If you guys think this is a good idea, please say something, so we can put
> more weight in and get it done.

I think it's a good idea by itself really. It also ties in with the
themes of emphasizing and strengthening JSF's strong point of being
able to do dynamic component tree manipulation (if I'm not mistaken,
not all component based web frameworks can do this), and the theme of
sorts to let the user work with the Java API from the point of view of
tag library URIs and tag names.

One thing I was thinking about though is whether it would make sense
to have an additional method returning a List<UIComponent> for those
cases that the user indeed wants to have all the components in the
Facelets include or Facelets tag and doesn't want the wrapper. Or,
would the user be expected to simply take the components from the
children collection of the wrapper component and then discard the
wrapper? I would be okay with either solution I think but just wanted
to throw the idea out there.

Kind regards,
Arjan Tijms