It’s been quite some time since I’ve started playing with AjaxAnywhere which I think one of the most interesting Ajax Frameworks out there drawing attention. Nowadays I’ve paired with Kenan Sevindik and began to explore the possibility of using AjaxAnywhere in our project. The idea behind is quite interesting actually, you specify zones in your page and these zones in dom are reloaded using javascript library of ajaxanywhere. The best thing is you do not need to change your current structure, just specify zones, add the zones to be refreshed and tada: the zones are reloaded with no postback.
The framework uses it’s own filter to manipulate the flow and currently it both supports jsp and jsf. The main idea is the following; The form is submitted as a whole actually not just the zones, the JSF components(zones) output spans with the components’ ids, when the response reaches, the inner html of the span is set by the mechanisms in aa.js of ajaxanywhere.
The Good
I’ve managed to apply some cool ajax features in few minutes using the framework. For example, I’ve created two dependent comboboxes, and a datatable presenting the search results with no postback. I think these are nice examples that AjaxAnywhere can do to satisfy the impatient client. AA is very useful in these cases and considering the workload to create the same thing with phaselisteners, xml parsing, etc, it just rocks.
The Bad
The framework is useless in some cases. Since it is likely to have scripts and hidden fields in a page which cannot be located in an aa zone, problems begin to occur. Unfortunately we are using ibm jsf, where there is a script collector component on top of the h:form collecting scripts form components and outputs them in encodeEnd. In order to overcome the reloading problems of hidden fiels(e.g. state) and scripts, we have written a PreSendHandler class that takes the response and reloads the scripts-hidden fiels using javascript. We used nekohtml the parse the response buffer and dom inspector(for testing) to traverse the dom tree. However the idea failed because of the problems occured in programmatically manipulating scripts-hidden fields of the dom tree at runtime and ibm’s bad designed scripts. In addition one more disadvantage is, since the whole page is submitted, you should not get the performance you expect and the validation conversion errors are another question.
The Ugly
IBM’s approach to JSF, not related with AjaxAnywhere actually:)
What I can tell briefly about aa is; it rocks on simple cases I’ve mentioned but do not expect much on complex ones.