maxlength for JSF TextArea
I am using <h:inputTextarea maxlength="50" />
I already have a javascript inplace where it will read the maxlength and only allow 50 characters (in开发者_如何学Go our example) it works fine with textarea but not with h:inputTextarea.
thanks
h:inputTextarea doesn't support the maxlength attribute:
http://download.oracle.com/docs/cd/E17802_01/j2ee/javaee/javaserverfaces/2.0/docs/pdldocs/facelets/h/inputTextarea.html
The html textarea element doesn't have that property prior to html5 which is why it's not supported. You can of course validate the length with a jsf validator to enforce the max size server side and as you are already doing use javascript to limit the input for those clients that support js.
精彩评论