PDA

View Full Version : Ajax Field Validation



stan229
22 May 2009, 5:59 AM
Has anyone thought of a way to implement Validator to support making a RPC call to see if the field value is valid or not?

Reason I need a validator is I want to check if the field value exists in some table. I do not want to store the entire table data on the client as it can become quite large.

Any ideas would be welcome.
Thanks
-Stan

FireGlow
25 May 2009, 4:32 AM
You can use a keylistener that fires everytime a key is typed.

you can just submit your form and check the values in your businesslogic throwing an exception if something doesn't fit. Using the exception to show the user where he has to change data.

I guess (don't really know) you can add an Validator-object to your field, that can fire as well a asynccallback without problem.

You can override the isValid() method of the formpanel.