myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aleksei Valikov <>
Subject Re: AJAX for JSF
Date Tue, 12 Sep 2006 15:20:52 GMT

> AJAX and JSF can definitely work together, but it's tricky because AJAX 
> can't be added incrementally; it has to be built into the JSF components 
> themselves.

ajax4jsf is capable of adding AJAX functionality to the existing JSF components. 
That's the incremental addition you talk about.

> You might also want to some commercial JSF frameworks that support AJAX. 
>  I've looked at ICEfaces a little and it seemed like it was on the right 
> track.  There may be something along those lines in Oracle ADF at some 
> point as well.  And the status of the open-source ones seem to change 
> monthly if not weekly.

ICEFaces has a pretty nice idea that, I think, can be adapted. They hav 
so-called direct-to-DOM render kit. That is, components are rendered not as 
plain text but as a DOM tree. This allows easily identify subtrees that have to 
be synchronized with the client. What client sees in his browser is just a 
replication of the server-side DOM tree, synchronized via AJAX.

ajax4jsf uses a different approach. When you use AJAX controls from ajax4jsf or 
ajaxify existing controls with their a4j:support, you provide (1) hook onto 
client-side event that triggers AJAX synchronization and (2) (possibly via value 
binding) a ids of the components which have to be rerender. Server-side AJAX 
handler then renders selected components and sends the result back to the browser.

The only problem with existing controls is that they need to be rendered as 
valid XML in order to be transferrable and parseable on the client side. 
ICEFaces solves this problem with own render kit (if you render DOM, it's 
already valid XML after all), ajax4jsf uses JTidy filter to clean up possibly 
malformed XML produced by components and their renderers.

By the way, requiring HTML but not XHTML was in my point of view an awful 
decision. Otherwise all the JSF component were ajaxifiable out of the box.


View raw message