Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » pre-submit validation of controls
pre-submit validation of controls [message #1184527] Wed, 13 November 2013 14:14
Ezequiel Panepucci is currently offline Ezequiel PanepucciFriend
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

Previous Topic:Data binding of dates and times
Next Topic:How can I programmatically expand items in a TreeViewer?
Goto Forum:
  


Current Time: Fri Apr 19 21:00:56 GMT 2024

Powered by FUDForum. Page generated in 0.03182 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top