This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes JSF and the fly likes custom renderer problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "custom renderer problem" Watch "custom renderer problem" New topic
Author

custom renderer problem

Jorge Fiallega
Greenhorn

Joined: May 27, 2005
Posts: 12
Hi:
I am trying to create a component, a renderer and a tag for such a component.

I am having troubles connecting the renderer. In the getRendererType() method of the UIComponentTag if I return null everything works fine although ofcourse my renderer is not used. Now if I return the renderer type specified in <renderer-type> of the faces-config then I get a NullPointerException.
java.lang.NullPointerException at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:676)
at javax.faces.webapp.UIComponentTag.encodeBegin(UIComponentTag.java:574)
at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:461)
at org.apache.jsp._test._jspService(_test.java:472)

Any ideas?

Thanks
Jorge Fiallega
Greenhorn

Joined: May 27, 2005
Posts: 12
OK, I found the problem. I need the method getFamily() in the component.

Thanks
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: custom renderer problem