• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Extending Standard Components

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://www.jsftutorials.net/components/index.html
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/J2EETutorial.pdf
 
francisco roman
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 1400
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
...intrigued.
 
francisco roman
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
could you cut and paste your example
 
Varun Khanna
Ranch Hand
Posts: 1400
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you elaborate where are you stucked?
 
francisco roman
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot Varun and Adeel,
I found the solution at the same time
I received your last message ;-)
 
Well THAT's new! Comfort me, reliable tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic