Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Checking field validity
Checking field validity [message #1284490] Fri, 04 April 2014 14:44 Go to next message
davide . is currently offline davide .Friend
Messages: 12
Registered: March 2014
Junior Member
Hi all. In my application I need to check the validity of data users enter in form fields. What I'd like to do is pretty basic: when user presses the OK button in a form, before calling the service to create/update the related db record, Id like to be able to write the code to check each form's field input and, if content does not match some criteria, show a simple dialog with customizable content.
So far I've not found, in the form code, any callback to do this. for example I've overridden the execValidate method. Here I can put the code for the checks, but if they fail the process is silently terminated, and no feedback is shown to the user. Am I supposed to open a dialog by myself?

what is the most "scout friendly" way to accomplish this? Maybe have I to do this in the service, returning a processing exception if fields contents does not match criteria?
Many thanks in advance.

Re: Checking field validity [message #1284510 is a reply to message #1284490] Fri, 04 April 2014 15:10 Go to previous messageGo to next message
davide . is currently offline davide .Friend
Messages: 12
Registered: March 2014
Junior Member
ok, stupid question. I should read documentation more thoroughly. I've overridden exceValidate() and raised a processing exception if fields' content is wrong. It works. Just let me know if I'm doing the right thing or if there some other alternative to explore.
Re: Checking field validity [message #1285247 is a reply to message #1284510] Sat, 05 April 2014 10:24 Go to previous message
Bertin Kiekebosch is currently offline Bertin KiekeboschFriend
Messages: 330
Registered: August 2011
Senior Member
Hi,

I normally throw a VetoException but both work. Example:

  @Override
  protected boolean execValidate() throws ProcessingException {
    if (getActivitiesField().getTable().getRowCount() == 0) {
      if 
        throw new VetoException("Select at least one activity");
      }
    }
    return true;
  }
Previous Topic:IShellService cannot open file
Next Topic:Multiline text in colum
Goto Forum:
  


Current Time: Tue Mar 19 03:16:12 GMT 2024

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

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

Back to the top