aspose file tools*
The moose likes JSF and the fly likes JSF inputTextarea Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF inputTextarea" Watch "JSF inputTextarea" New topic
Author

JSF inputTextarea

Ingoba Ningthoujam
Ranch Hand

Joined: Dec 04, 2006
Posts: 90
Hi All,
I am using h:inputTextarea. I want to fixed the content to 256 characters. I used the property maxlength but it is not working. My code is:


Please help me.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15657
    
  15

There are 3 things that determine the browser characteristics of an inputText field, and they are the same as those for the regular HTML INPUT tag, since that's what gets generated.

The maxlength attribute determines the maximum number of characters that the field will be allowed to hold. Once that limit is reached, the browser should refuse to accept any more, and might even flash or beep or something to provide user feedback. Whether it does any of the preceding is dependent on what brand and version of browser is being used.

The size attribute estimates the physical size of the displayed text control based on character count. size can be less than, equal, or greater than maxlength. It will not control what the user can input - if maxlength is enforced, you might have plenty of free space in the control, but the browser would refuse to accept text. Conversely, the text may not all be visible if the size attribute is smaller than the amount of text in the control. My experience has been that size is only approximate in my favorite browsers, but for variable-width fonts, it would have to be.

The CSS width property also can control the displayed size, but more precisely.


Customer surveys are for companies who didn't pay proper attention to begin with.
Ingoba Ningthoujam
Ranch Hand

Joined: Dec 04, 2006
Posts: 90
Thanks Tim. But the solution with the code will be more welcome. Please help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSF inputTextarea
 
Similar Threads
adding attribute to existing tag. How???
JSTL conversion question
how to display line break in browser using h:inputTextarea?
creating button using <s:button> - similar to the CSS based button
How to get Div values in the html