This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes JSF and the fly likes my component - my renderer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "my component - my renderer" Watch "my component - my renderer" New topic
Author

my component - my renderer

Eric Härtel
Greenhorn

Joined: Jun 08, 2009
Posts: 8
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

Joined: Jun 25, 2001
Posts: 17044
    
  26

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.


An IDE is no substitute for an Intelligent Developer.
Eric Härtel
Greenhorn

Joined: Jun 08, 2009
Posts: 8
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

Joined: Jun 08, 2009
Posts: 8
It is solved. The component class was derived from UIOutput, which returns always renderer type Text.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: my component - my renderer
 
It's not a secret anymore!