Skip to main content



      Home
Home » Eclipse Projects » Eclipse Scout » Checking field validity
Checking field validity [message #1284490] Fri, 04 April 2014 10:44 Go to next message
Eclipse UserFriend
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 11:10 Go to previous messageGo to next message
Eclipse UserFriend
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 06:24 Go to previous message
Eclipse UserFriend
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: Wed Jul 23 16:34:08 EDT 2025

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

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

Back to the top