Win a copy of Spring Boot in Practice this week in the Spring forum!
  • 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

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
 
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 ;-)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic