cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
Subject Re: <fd:validation><fd:javascript>
Date Thu, 27 Oct 2005 11:35:57 GMT
Upayavira wrote:
> Sylvain,
>
> I happened to be doing something similar at the time, so I looked at the
> code. Looking at:
>
> http://svn.apache.org/repos/asf/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/JavaScriptValidator.java
>
> Method validate(Widget widget), I notice:
>
>         if (result instanceof Boolean) {
>             return ((Boolean)result).booleanValue();
>         }
>
>         if (result instanceof ValidationError) {
>             // Set the validation error on the widget
>
> ((ValidationErrorAware)widget).setValidationError((ValidationError)result);
>         }
>
>         if (result instanceof String) {
>             // Set a non-i18n error on the current widget
>             ((ValidationErrorAware)widget).setValidationError(new
> ValidationError((String)result, false));
>             return false;
>         }
>
> The middle one of these if statements doesn't return anything, and will
> thus throw a RuntimeException at the end of the method. Is this correct?
>   

Ooops! No, this is definitely not correct!

I fixed it. Thanks!

Sylvain

-- 
Sylvain Wallez                        Anyware Technologies
http://people.apache.org/~sylvain     http://www.anyware-tech.com
Apache Software Foundation Member     Research & Technology Director


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message