pre-submit validation of controls [message #1184527] |
Wed, 13 November 2013 14:14 |
Ezequiel Panepucci Messages: 4 Registered: June 2013 |
Junior Member |
|
|
Dear All,
I have a View (eclipse 4 kepler) which contains many controls like Text, Spinner, Combo etc.
I am using the data binding framework to validate individual controls and add a tiny decoration to the fields requiring attention.
After the user has filed all fields they need to press on a button to submit the information to a queue.
I would like to implement a method to scan all of these fields and check if any of them are having IStatus.ERROR in them so that I can pop up a dialog informing the user that the respective field needs to be corrected.
How would I go about scanning these field and finding out what went wrong?
I tried the following but it does not pickup a field which has wrong data:
IObservableList vm = m_bindingContext.getValidationStatusProviders();
for (Object o: vm) {
ValidationStatusProvider v = (ValidationStatusProvider) o;
IObservable iob = (IObservable) v.getTargets().get(0);
if (v.getValidationStatus().equals(IStatus.ERROR)) {
System.out.printf("Field has an error.\n");
} else {
System.out.printf("Field has is ok.\n");
}
}
Any advice is greatly appreciated.
Kind regards,
Zac
[Updated on: Thu, 14 November 2013 08:17] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03098 seconds