This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JSF and the fly likes adding attribute to existing tag. How??? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "adding attribute to existing tag. How???" Watch "adding attribute to existing tag. How???" New topic
Author

adding attribute to existing tag. How???

ira romanenko
Greenhorn

Joined: Aug 07, 2006
Posts: 4
Hello all!
Could you help me?
I need to add attribute maxlength to tag <h:inputTextarea>, but don't know how to do it.
Could you give me some advises?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 14480
    
    7

You can't add attributes to tags, whether JSF or plain JSP tags. Instead, you'd have to subclass the tag, extend it, and declare a TLD for the extended tag.

However, what you're asking for is part of the standard property set for that tag, so you don't need any extensions to do that. Here's a working example:


Customer surveys are for companies who didn't pay proper attention to begin with.
ira romanenko
Greenhorn

Joined: Aug 07, 2006
Posts: 4
Thank you, but I need inputTextarea, not inputText
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 14480
    
    7

Ooops. Sorry about my inability to see the obvious. But isn't that set as the product of rows= x cols= ?

If not, I suppose a validator is in order.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: adding attribute to existing tag. How???
 
Similar Threads
Problem in passing a parameter to the function
Passing ArrayList to JSP custom Tag?
Regarding Tiles in Struts 1.1
Validate method
Advanced Applet Question