myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexandr J. Smirnov" <>
Subject Demo for AJAX faces componets
Date Fri, 05 Aug 2005 13:32:16 GMT

After any little problems,  my demo/test application visible from internet.
You can see it by : .
 At present, it was tested with Firefox 1.06, Microsoft IE 6.0 and 5.0 (
from default install of Windows 2000 ) and Opera 8.02
I will be very glad for report of success/failure test on other browsers.

My skills in JavaScript less then 1 month, but long time I worked with java,
c, c++ - as result,  I was surprised many times by unexpected work of any
I don't have any problems for server side part, but need any help for build
client-side scripts... Most in creating portable code for different clients.

Do you have a demo of this technology up and running?

Can you start a discussion with code snippets on the mailing list how you
implemented that?

How many changes would it take to get My Faces to use your approach?



On 8/2/05, Alexandr J. Smirnov <> wrote:
I have worked ( as alpha-alpha-alpha .. ) set of custom components for
create AJAX-like user interfaces for Java Server Faces Applications. Main
idea - in faces lifecycle, ve have view tree on server side and DOM tree in
client browser ( at present, saving tree on client side don't used ). For
ajax request, client send all user input of current form ( as normal submit
request ). Request phases work as usual, but on render responce phase server
send ONLY CHANGED parts of view ( i don't create full compare, but send only
fo pre-defined parts, or submitted form ). For this I created special
AjaxContainer component, wich render it's children ( or part of children )
components. List of clientId's for rendered components included in response
for client-side part of framework.
For other cases ( for example, such will work in-page Jabber client  )
component can render updated xml in custom Listener, and set
responseComplete  to FacesContext.

On client side, JavaScript get list of rendered parts and update page DOM
In result, we have two-way communications between client browser and JSF
view, and have sync tree's on client and server side. It's work like common
desctop applications.
Such arch don't need create special RenderKit or change most of
components - for example, at present, I have only custom tag's-renderers for
UICommand ( link & Button ) components, and have worked all standart and
most of custom ( tree2 and any other Myfaces components ) as AJAX ... On
other hand, custom renderers  based on usual Html renderers, and work also
in non-JavaScript environment as simple html...

For client side script use XMLHttpRequest object, and, if it don't exist,
special "JavaScript"HttpRequest. It's worked same as XMLHttpRequest (
designed with same properies and methods ), but use other idea. For perform
request, It appended to page <script> tag. Browser load script ( url maked
from form action url with query string as normal GET request ), but script
produced by special Filter on server from Html code of JSF Response - as
pseudo-Dom tree of objects. Loaded script call handler function for update
page - same as XMLHttpRequest. Not need any iframe or other incompatible
technologies for non XMLHttpRequest browsers.
It can work in wide range of browsers, even in 4+ IE & Netscape  ???
( in theory. At present tested with Mozilla Firefox and IE 5.5+ browsers. I
need help for make JavaScript compatible with others. )
At present, XMLHttpRequest work only in Mozilla. Code for MS ActiveX was
disabled since I don't can get any functionality of XML part for microsoft
object ! Xml parsed withowt errors. ( For xml request, i use in servlet
Filter nekkohtml parser, and make valid xml, with all declarations and
mime-type headers ). It make responseXML Tree, but any methods for
navigate/manipulate don't worked ! Also, elements from responseXML can't be
inserted to page, don't produce event handlers etc.
Current view of code repository - Project created in Eclipse.
Sorry for possible mistakes - my native language is Russian.
Alexander J. Smirnov

View raw message