• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

TLD for custom JSF UI component

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have implemented a custom JSF UI Component that extends HtmlGraphicImage. I have introduced a couple of new attributes for my tag by specifying them in the tld file. The new attributes work fine.

But I also want to expose the attributes of h:graphicImage (the component I am extending). To achieve this I have copy pasted graphicImage's attributes from graphicImage's tld file into my tld. Is there a better way to expose the attributes of the base component that I am extending on the tld?

TIA,
Chandan
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Chandan Rajan:

But I also want to expose the attributes of h:graphicImage (the component I am extending). To achieve this I have copy pasted graphicImage's attributes from graphicImage's tld file into my tld. Is there a better way to expose the attributes of the base component that I am extending on the tld?



I'm not sure how easy it would be to apply this technique to your project now, but you might find this useful either way:

http://java.sun.com/developer/technicalArticles/J2EE/jsf_templating/index.html

That's the approach Mojarra Scales uses, and I like quite a bit. I should, since I co-authored that article, right? :P By using annotations and apt at compile time, I have the TLD, JSP Tag, and Facelets taglib.xml generated for me. This article uses a JSFTemplating-based Renderer, but there's no need for you to do so if you don't want to (though I've found that template-based Renderers are often a lot easier to maintain, as I don't have a million writer.write*() calls).
[ April 29, 2008: Message edited by: Jason Lee ]
 
Chandan Rajan
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Jason. The approach is pretty interesting. Unfortunately, we are still in java 1.4. So it will be sometime before we move on to 1.5.
 
Story like this gets better after being told a few times. Or maybe it's just a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic