File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Extending Standard Components Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Extending Standard Components" Watch "Extending Standard Components" New topic
Author

Extending Standard Components

francisco roman
Ranch Hand

Joined: Jun 22, 2005
Posts: 31
Hi Gregg hi guys,
I would like to extend the behaviour of the standard
component <h ataTable/> writing my own renderer.
Any idea is welcome.

cheers
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
http://www.jsftutorials.net/components/index.html
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/J2EETutorial.pdf
francisco roman
Ranch Hand

Joined: Jun 22, 2005
Posts: 31
very efficient indeed,

thanx,
I 'll have a look
francisco roman
Ranch Hand

Joined: Jun 22, 2005
Posts: 31
.. now.
Those user guides you mentioned are fine to begin with
custom tags, it seems. What I am interested instead is how
to extend the standard <h ataTable> without writing an entire
custom tag but simply rewriting the renderer class. I hope
this can be clearer.
Varun Khanna
Ranch Hand

Joined: May 30, 2002
Posts: 1400
Originally posted by francisco roman:
.. now.
Those user guides you mentioned are fine to begin with
custom tags, it seems. What I am interested instead is how
to extend the standard <h ataTable> without writing an entire
custom tag but simply rewriting the renderer class. I hope
this can be clearer.


i) Extend the existing renderer,
ii) Register the new render in faces-config.xml file

That's it


- Varun
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by Varun Khanna:
i) Extend the existing renderer,
ii) Register the new render in faces-config.xml file
That's it


Its really as simple as said by Varun.

Moreover, we have a chapter on "Extending components and renderers" in "OReilly - Java Server Faces By Hans Bergsten". Its a nice one.
francisco roman
Ranch Hand

Joined: Jun 22, 2005
Posts: 31
...intrigued.
francisco roman
Ranch Hand

Joined: Jun 22, 2005
Posts: 31
guys,
extending com.sun.faces.renderkit.html_basic.TableRenderer
is not as straitforward as you might think, if not impossible.
Have you tried?
francisco roman
Ranch Hand

Joined: Jun 22, 2005
Posts: 31
.. the name of the package is a bad sign.
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by francisco roman:
guys,
extending com.sun.faces.renderkit.html_basic.TableRenderer
is not as straitforward as you might think, if not impossible.
Have you tried?


I have done with HtmlBasicInputRenderer and ListboxRenderer. Sorry never came across TableRenderer. But I hope it should be something similar.
Varun Khanna
Ranch Hand

Joined: May 30, 2002
Posts: 1400
Originally posted by francisco roman:
guys,
extending com.sun.faces.renderkit.html_basic.TableRenderer
is not as straitforward as you might think, if not impossible.
Have you tried?


Yes.

Where are you getting stucked?
francisco roman
Ranch Hand

Joined: Jun 22, 2005
Posts: 31
could you cut and paste your example
Varun Khanna
Ranch Hand

Joined: May 30, 2002
Posts: 1400
Can you elaborate where are you stucked?
francisco roman
Ranch Hand

Joined: Jun 22, 2005
Posts: 31
a test renderer is ready. Now how do I
link it to the tag <h utputText />
and what to put into <render-kit/>

cheers
Varun Khanna
Ranch Hand

Joined: May 30, 2002
Posts: 1400
Sample code to be added for Table renderer in faces-config.xml


I hope you are not using dataTableRenderer for outputText.
francisco roman
Ranch Hand

Joined: Jun 22, 2005
Posts: 31
Thanks a lot Varun and Adeel,
I found the solution at the same time
I received your last message ;-)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Extending Standard Components
 
Similar Threads
Why it is better then JSF?
Restaurant DTD
Agilian - Standard Edition Vs Professional Edition?
Secure Socket Port
Simple vs Classic Tags - When ?