I did a search and was not able to find it. We have a Spark TextArea with maxChars="3900". But it doesn't work when copy/paste to the text area. I tried to add this to the changingHandler:
if (ta.text.length > 3900)
{
Alert.show("The maximum characters length is 3900. Please limit the characters to the max limit");
ta.text = ta.text.substr(0, 3900);
} else
{
if (event.operation is PasteOperation)
{
....//Other logic
}
}
The problem is it does not work all the time. The Alert shows up only some times when it is over 3900 chars. Not sure why. I also added the same to the changeHandler as well. But that does not get triggered at all.
Please let know what I'm missing. I need to show an alert & trim the chars to the max each time it goes above the max limit.
Thanks
Harish