Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
[SF] Synch using Ajax
Last updated at 5:42 am UTC on 16 March 2009
This little guide will, hopefully, serve as an introduction to those who are not fluent in AJAX technology. If you already know how AJAX works, you can read directly how to use the API. We're going to review some elemental concepts needed to develop with AJAX

General Concepts

AJAX synchronization in SmallFaces

AJAX lets you synchronize the client and server in a very flexible way. Therefore we have two types of communication from client to server and vice versa.

Synchronization from the client to the server

Here something happened in the client, and we must update the object that represents the control (in our Smalltalk image) according to the changes made by the user in the client, read, Internet browser.
SFClientToServer.jpg

So modifying the value in the client's texfield with 'Francis Cornford', at some time, the object which represents the control on the server/image (an SFTextField) must be updated. When to update? This depends of your interactions needs, so this time is configurable. For example, when a SFTextField is given a new character or when it loses the focus of the mouse, or when an item from a SFListBox in the document is selected.

Synchronization from the server to the client

This happens when you modify a widget in the server/image, and you have to update the control on the client. For example when writing the first name and last name in two text fields, when the focus is lost in the later, you want to update a third texfield with the first and last name, performing some validation possibly.
SFServerToClient.jpg

More or less that's a simplified idea of the use of AJAX, and the next logical step is actually how to use it in SmallFaces