-
26 Mar 2012 3:04 AM #1
Calculation of the textLength in a TextArea
Calculation of the textLength in a TextArea
Hi,
the length of a value in a TextArea is calculated differently for IE and FF, so that the validation for the maxLength of the TextArea does not work correctly.
You can try it for the following Text (set the maxLenght property of the TextArea to 11):
Text1
Text2
The returned value in IE is Text1\r\nText2. The FF gives Text1\nText2 as value. So the textLength in IE is 12 and in FF 11, i.e. the TextArea in FF is valid and in IE is not.
Is there any way to fix this?
Thanks,
Vlad
System:
Win7
IE8
FF10
GXT 2.2.5
-
26 Mar 2012 4:39 AM #2
Best Solution
Best Solution
if I were you I will override validateValue method like following:
Code:TextArea taAddress = new TextArea() { @Override protected boolean validateValue( String value) { boolean result = super.validateValue( value ); if ( !result ) { return false; } // your solution comes here // if you want to omit /r/n return true; } };
-
30 Mar 2012 5:52 AM #3
Of course I can override the validateValue() method. But in this case it is not so elegant. Different systems and Browsers handle line break differently. So details should be counted in my implementation.
What does the development team suggest for this? Is it possible to fix this on the GXT side?
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote