Hmmmm... I presented something similar to this at JavaOne (called "intuition"), except that it focuses more on component creation (although the render kit part is just a step further). I was talking to Jacob Hookom about including it in Facelets, since it uses Facelets for the template (although that's not required). He wasn't terribly interested, though, so I haven't quite figured out where it should go...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Kito D. Mann - Author, JavaServer Faces in Action http://www.virtua.com - JSF/Java EE consulting, training, and mentoring http://www.JSFCentral.com - JavaServer Faces FAQ, news, and info * Sign up for the JSF Central newsletter! http://oi.vresp.com/?fid=ac048d0e17 * > -----Original Message----- > From: news [mailto:[EMAIL PROTECTED] On Behalf Of Laurie Harper > Sent: Friday, June 29, 2007 4:51 PM > To: [email protected] > Subject: Re: Renderkit using Freemarker templates > > The performance question is a good one, but I thought I'd throw > something else into the discussion... I've thought about creating > something like this a number of times, as a way to make components more > flexible for the user. > > When a component has more complex rendering, I often find I'd like to > be > able to tweak the generated HTML in ways that simply aren't possible > without replacing the renderer. If the renderer was driven by a > template > *and* there was a supported mechanism for specifying a custom template > (on a per-component-use basis or even just on a per-application basis), > this would be much easier. > > On the other hand, the potential for people breaking the component by > changing the render template in unexpected ways is a little > unsettling... > > L. > > Adam Winer wrote: > > When I've thought of this, I've always imagined that > > really complex renderers would end up requiring > > Java code, and that really simple renderers, well, > > aren't that hard to write in the first place, and would be > > much slower when written that way. At that point, > > I gave up and worked on things I was sure would work. :) > > > > Templating a la Facelets has seemed like a pretty > > good middle ground for assembling on-the-fly > > components. > > > > That said, I'd be absolutely thrilled to proven wrong! > > So I guess two questions: > > - Have you had a chance to benchmark the Freemarker-coded > > outputText against the one in MyFaces? > > - Any chance of tackling a complex component so we could > > see what it looks like? > > > > -- Adam > > > > > > > > On 6/28/07, Jurgen Lust <[EMAIL PROTECTED]> wrote: > >> Hi, > >> > >> I think most people will agree that writing Renderers for JSF > components > >> using the standard tools, i.e. ResponseWriter.startElement and > >> ResponseWriter.writeAttribute etc., is not very straightforward or > >> productive, especially when creating complex components. If you take > a > >> look at > org.apache.myfaces.custom.schedule.ScheduleDetailedDayRenderer, > >> you'll know what I mean :) > >> > >> One of the great things about Dojo is that you can create templates > for > >> your components. Inspired by this, I tried to do something similar > for > >> JSF renderers, using Freemarker. I put it in the sandbox, and wrote > a > >> replacement HtmlOutputTextRenderer based on it. I know the > outputText is > >> a bad example for this, but for complex stuff, this could be really > >> useful. > >> > >> What do you think? > >> > >> Jurgen > >> > >
