Thanks for replying.
My validation was working fine. The problem was that I wanted the focus to
be on a particular field in the error display page(The page from which the
request originated). I referred to the bugzooky example and found out my
mistake. Now it is working as I want it to. Thanks once again for replying.
BTW stripes is a kick ass framework :). Keep up the good work.
On Wed, Oct 29, 2008 at 4:01 PM, Oscar Westra van Holthe - Kind <
[EMAIL PROTECTED]> wrote:
> On 29-10-2008 at 14:37, Abhirama Bhat wrote:
> > I am using custom validation. When there is an error and the error
> message
> > is displayed is there a way to tell stripes on which field the focus
> should
> > be?
>
> First, I'm assuming you've created a method that is correctly called to
> validate your input, and you can even log the validation result.
>
> The problem you describe is to put the validation error somewhere Stripes
> can
> pick it up. You'll want access to the ValidationErrors object to do this.
>
> Documentation URL:
> http://www.stripesframework.org/display/stripes/Validation+Reference
>
> As documented at the URL above (search for "ValidationErrors"), you can get
> this object in two ways. For validation methods, I prefer the second:
> @ValidationMethod public void validateSomething(ValidationErrors errors) {
> ... }
>
> You can then add your error message like this:
> errors.add("fieldName" new LocalizableError("messageKey"));
> or:
> errors.addGlobalError(new LocalizableError("messageKey"));
>
> Note that this constructor has a varags argument Object... parameters to
> specify parameters for the message.
>
>
> Oscar
>
> --
> ,-_
> /() ) QED - Quite Easily Done
> (__ (
> =/ ()
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Stripes-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users