Even though GWT text area contains text when the validate is method is called it fails.
//Populating the data in a seperate method
evntCommonWidget.getDescription().setText(obj.getDescription());
//test to check whether data is getting populated
int curPos=this.getDescription().getCurrentValue().length();
GWT.log("text area text size "+curPos);
this.getDescription().setAllowBlank(false);
//Validation process
if (!description.validate()) {
this.getDescription().focus();
return false;
}
Log shows, 00:12:12.550 [INFO] text area text size 4.
What is going wrong ? Please help to resolve
The source of the problem is mentioned in the javadocs for
setText
(emphasis mine):You should use the
setValue(value, true)
method instead -true
is needed to fire theValueChangeEvent
and trigger validation.