PDA

View Full Version : ListField Validation



r4nd7263
13 Oct 2011, 5:18 AM
ListField has no setValidator method.

According to API, I override validateValue() and that works, but how do I set the error text?

I tried

this.getMessages().setInvalidText("A selection is required.");

in validateValue() before I return false.

r4nd7263
13 Oct 2011, 6:41 AM
markInvalid("message"); in validateValue() works

However tracing the source code I found out setSelection() performs validation before setting selections. To make matter worse, rawValue is always empty string in ListField. So it seems to me when invoking setSelection manually, validateValue() will always validate the outdated selection.

I am manually clear invalid or revalidate after setSelection. Using GXT 2.2.4