[aida] Ajax improvements

Janko Mivšek janko.mivsek at eranova.si
Thu Oct 23 11:21:41 CEST 2008

Dear all,

As Nico already mentioned I did recently some Ajax improvements in Aida 
and maybe you'll be interested to read about that bit more.

Let me start with a short intro to Aida Ajax support.

As you know in Aida we have an integrated Ajax support, which allows us 
to do things like immediate posting of an input field very easily:

	(e addInputFieldAspect: #name for: aPerson)

This will send and update on the server the name of that person 
immediately after entered, via Ajax call in the background. Another nice 
feature is to refresh some element on the webpage after such a change:

	(e addInputFieldAspect: #name for: aPerson)
		onChangePostAndUpdate: someElement

So, besides posting we will also update the specified element on the 
webpage, to reflect a new content we just entered in the input field.

Those two examples show basically the main strengths of Aida Ajax 
support. You can see that we stay in the Smalltalk all the time and we 
don't need to deal with HTML and Ajax things like web element ids, which 
are mandatory for Ajax. Those ids are namely needed to uniquely identify 
an element of the webpage:

	<DIV id="id37">..</DIV>

While most of other web frameworks force you to do that manually, Aida 
do it automatically. And this magic was a subject of recent improvements.

All starts when a checkbox Ajax update didn't work well. You could check 
but not uncheck. But this then reveal more problems with id registration 
machinery. Problem is, that id of updated element need to stay the same 
as of old element and this copying and re-registering of new element in 
place of old one was problematic in certain cases. I cleaned up that 
part of the code which is now also more simple to understand and from 
testing so far it seems it cover all cases reliably.

Best regards

Janko Mivšek
Smalltalk Web Application Server

More information about the Aida mailing list