Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

question about extending component capabilities

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In JSF, Is there a way to extend one of the current components capabilities without rewriting the whole component. For example, say I wanted to add some new elements to a textbox but I didn't want to rewrite an entirely new textbox object. Can anyone provide me with examples of how this would be done. I have done it before in dot.net with relative ease. Any help would be greatly appreciated.
 
Saloon Keeper
Posts: 24330
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think someone asked this same question a month or 2 back, so you might want to search the forums.

Short answer: JSF objects are subclassable, so yes, you can extend them. However you'll have to define a new tag and associated TLD to associate this newly-enhanced object type with appropriate descriptions of its capabilities.
 
Anthony Taylor
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah, I searched through some of the examples on this site but none really answered the question. Suppose I wanted to extend the textbox tag in the following manner : <h:inputText id="name" attribute1="value1" attribute2="value2" value="Hello world"/>. In this example, attribute1 and attribute2 are not standard attributes. What all needs to change to make something like this work? The rendered, the actual class that represents this tag behind the scenes. I guess I am looking for a definitive example or set of steps to take to achieve this goal.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic