Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

my component - my renderer

 
Eric Härtel
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody,

I'm writing my first component, and something with the component renderer relation doesn't work. I use JSF with facelets and started at the taglib.xml with


Thereafter I added the faces-config.xml with the component and the renderer in the renderer-kit



IMHO that should be enough to connect a component to the appropriate renderer. In the server log I found this during serverstartup:


Now the problem, when I try to render my Rect the following error is shown in the server log:


As you see, the render-type is wrong. Does anybody have some sugestion how to connect the component with the renderer.

Greetings
Eric
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18218
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the component renders itself, the renderer-type defined in the component should be null. The stock HTML renderer types are tied to specific HTML elements and JSF decided that you're planning on rendering an HTML input text box element.

I'm surprised you got what you did, though, since Facelets puts its own spin on custom tags and their rendering. Which, alas, I've not seen clearly explained.
 
Eric Härtel
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The component should not render itself. There is a component class Rect holding height and width and all that stuff, and there is a class RectRenderer.
 
Eric Härtel
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is solved. The component class was derived from UIOutput, which returns always renderer type Text.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic