This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Extending Standard Components

 
francisco roman
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
francisco roman
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
very efficient indeed,

thanx,
I 'll have a look
 
francisco roman
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
.. 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
Posts: 1400
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...intrigued.
 
francisco roman
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
.. the name of the package is a bad sign.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1400
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
could you cut and paste your example
 
Varun Khanna
Ranch Hand
Posts: 1400
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you elaborate where are you stucked?
 
francisco roman
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1400
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Varun and Adeel,
I found the solution at the same time
I received your last message ;-)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic