I added, as a prototype only so far, XmlHttpRequest-based client-side validation in WebWork 2.1.7.
Right now it is set up such that on every “onblur” event, a request is sent out to a special ValidationServlet, which sends back an XML response indicating the validation results. Then, using DOM, we insert the response in to the form dynamically.
This is just the start of some of the things I want to start doing with WebWork, all in effort to make the UI part of the framework much more rich.
on Dec 15th, 2004 at 12:34 pm
Javier,
Good points — this is just a prototype right now. I intend to update the javascript to be much smarter about how to handle bandwidth, which should lessen your worries. Right now it is really niaive in that it checks on every onblur. Right off the bat we could fix that by making the javascript not send a request when the data hasn’t changed. Similarly, if the user is a quick typer, we could bulk up requests.
This will be an evolving project, but I wanted to kick it off with a functional demo.
on Dec 15th, 2004 at 2:13 pm
Neat stuff Pat. When I read the recent articles on Googles use of XmlHttpRequest I immediately started playing with it and validation was one of the things which seemed like a good use case for it. As Javier points out though calling the server on every blur is going to cause a lot of traffic. Anyhow, I’ll be keeping my eye on what you are doing as it sounds like it will be a good addition to FormProc (and to web forms in general) down the line.