One of the cool things about Seaside in general, and about Web Velocity in particular, is how easy it is to add ajax into your web app. I did a tutorial on this with straight Seaside, and I've done screencasts on it for Web Velocity.
The basic steps in Web Velocity are pretty simple though - you add the Javascript library you want to use to your component - that's a simple menu pick in the WV environment. Now, say you want to change an input field from updating on submit to updating on change. Here's the "on submit" code:
html textInput on: #fieldName of: someObject
On submit, that will send the #fieldName: message to someObject with the new value. Simple, right? Here's the version that updates on change instead of submit, using Mootools:
html input changeCallback: [:renderer :newValue | searchVal := newValue].
You get the renderer sent in in case there's a piece of the UI (typically one or more divs) that need to be updated. Otherwise, the code is straightforward, and that's what I like about Seaside: programming a web gui in Seaside is very much like programming a client GUI - so the instincts you've built up over years of that style of development are still good. Very cool stuff
Technorati Tags:
smalltalk, web velocity