Is there a way in which i can restrict the no of lines entered in text area
Current behaviour seems to allow user to enter any no of lines i need to
restrict this to allow only 4 lines and not more that .
I tried overriding the caret update in my own extension
it started giving Attempt to mutate in notification exception
public class UIMyTextArea extends UITextArea {
@Override
public void caretUpdate(CaretEvent e) {
// TODO Auto-generated method stub
//super.caretUpdate(e);
String text = getValue().toString();
StringBuffer textbuf = new StringBuffer(text);
final int size = text.length();
final int maxSize = 50; // no of characters could be anything
System.out.println("Text Area String "+size + " Max Size"+maxSize);
if (size > maxSize)
{
textbuf.delete(0, size - maxSize);
setText(textbuf.toString());
}
//vBar.setValue(vBar.getMaximum());
}
}
Tried the samething with filterinput only to give me heap overflow errors
Thanks and Regards ,
Gene
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
