-
Unanswered: length of GXT HtmlEditor
Unanswered: length of GXT HtmlEditor
Hi All,
How i can set length (chars) of HtmlEditor? look like i missing somethings in the docs ...
-
detail?
detail?
Can you say a little more detail ?
-
You can't, HtmlEditor extends Field, But MaxLength is only starting with TextField
So, you must write your own, and do like TextField, overriding the validateValue
new HtmlEditor(){
@Override
protected boolean validateValue(String value) {
boolean result = super.validateValue(value);
if (!result) {
return false;
}
//COPIED FROM TEXTFIELD
int length = value.length();
if (length > maxLength) {
String error = "";
if (getMessages().getMaxLengthText() == null) {
error = GXT.MESSAGES.textField_maxLengthText(maxLength);
} else {
error = Format.substitute(getMessages().getMaxLengthText(), maxLength);
}
markInvalid(error);
return false;
}
}
};
-
I forgot to tell:
//MAKE YOUR OWN GETTER/SETTER for MaxLength
private int maxLength;
Sencha is used by over two million developers. Join the community, wherever you’d like that community to be
or Join Us