Ability to downgrade Severity

  3 posts   Feedicon  
Replies: 2 - Last Post: December 04, 2009 19:29
by: hugoheden
showing 1 - 3 of 3
 
Posted: November 26, 2009 17:59 by Tim Boudreau
One issue mentioned elsewhere was the desire to use the built-in Validators for non-fatal conditions (I think the only one that does not use Severity.FATAL is the URL validator that may tell you an internet host name is longer than some browsers handle).

So now, if you want to, say, suggest to the user that a field not be left blank, but not require it not to be blank, you can do


Validator<String> v = Validators.limitSeverity(Severity.WARNING,Validators.REQUIRE_NON_EMPTY_STRING);
validationGroup.add(theTextField, v);


and you'll get a warning message instead of a fatal message.
 
Posted: December 01, 2009 08:30 by mkleint
sounds like a good improvement.. I was actually wondering how to do that a while back but didn't need it in the end.

Milos
 
Posted: December 04, 2009 19:29 by hugoheden
Sounds very useful. Not sure about the name "limitSeverity".. In the future we may want to support "upgrading/increasing" severity as well (if we add built-in Validators that default to Severity.WARNING or info).. so how about "withSeverity", "changeSeverity", "overrideSeverity" or something like that?
Replies: 2 - Last Post: December 04, 2009 19:29
by: hugoheden
  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2010, Oracle Corporation and/or its affiliates
(revision 20120518.3c65429)
 
 
Close
loading
Please Confirm
Close