> Craig McClanahan wrote:
> > If you want to dynamically compose child components, why not just add
> > them to the component tree programmatically?
> > 
> > Assume you have an outer component to which you want to dynamically
> > add a form with a bunch of fields, where you don't know which ones
> > you'll need ahead of time.  Something like this will work:
> > 
> >     OuterComponent outer = ...; // Get reference to the component that
> > will be the parent
> >     HtmlForm form = new HtmlForm();
> >     form.setId("form1");
> >     form.setXxx(...); // Set other properties
> >     outer.getChildren().add(form);
> >     ; // Do the same thing adding children to the form
> > 
> > When you're through, the components you just created can render
> > themselves.  The only tricky detail to remember is that the outer
> > component has to return true for the rendersChildren property.
> Yes, building the component tree works if I want to add JSF components 
> only. My example was misleading in the case that it showed I want to use 
> JSF component. In fact we would have to use a custom JSP tag instead. I 
> fear there is really no way of doing that in a reasonable way (means 
> without jspc ;-) )
> 
> example:
> writer.write("<ng:myCustomTag ...>");
> 
> I fear we really have to create a JSF component out of our custom tag.

If you are looking for an alternative to JSF JSP tags, you might check out 
Shale Clay.  The rolodex usecase example shows several alternatives.  

http://cvs.apache.org/builds/struts/nightly/struts-shale/use-cases/


One of the options is to use an html template to add components to the 
component tree.  You can also define complex components bound together that are 
reusable and still provide inheritance like you might see in a rich GUI 
environment like Delphi or PowerBuilder. 
 
http://struts.apache.org/shale/features.html#clay

Gary

> 
> Matthias


Reply via email to