Thursday, January 20, 2011

Re: Client en Server side validation

I've got 2 types of validation. Syntax and business rules.
The syntax can be solved in the presenter, but i don't want to
validate the whole bean if i only want to validate one property of
that bean.

I'm thinking to make it like this:

Class Foo() {
Date date;
String otherfield;

public validateAndSetDate(String textFromWidget, Error errors) {
// try to make the string into a valid date with some date utils
if not ok, than fill the errors object with an error message
}

Now i can try to set the value after a onBlur() in the presenter to
try to update the model (Foo)

But i want to do the same on the server after a RPC call because the
user could possible tamper the data somehow....should i than check all
the validateSetters? of all my properties with
validateAndSetDate(foo.getDate.asString(),errors) ??

I would be nice that i only check the changed properties after my last
RPC call. Any ideas?

Thanks.

Jeroen

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate