cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
Subject Re: Transparent and automatic AJAX support for CForms
Date Sat, 16 Apr 2005 12:28:25 GMT
Leszek Gawron wrote:

> Ben Pope wrote:
>
>> Sylvain Wallez wrote:
>>
>>> Hi all,
>>>
>>> I've been thinking for a few weeks to add AJAX support to CForms. 
>>> Ajax is the current buzzword in the blogosphere since Google maps 
>>> [1] started and the folks at Adaptivepath found this name for the 
>>> XmlHttpRequest + JS + XML combo [2].
>>
>>
>>
>> <snip/>
>>
>>> Two days hacking, most of which dedicated to writing client-side JS 
>>> and solving cross-browser compatibility problems and here we are: 
>>> adding ajax="true" on <ft:form-template> turns on the magic.
>>
>>
>>
>> <snip/>
>>
>>> I have turned on ajax mode on the following samples:
>>> - http://localhost:8888/forms-samples/carselector
>>> - http://localhost:8888/forms-samples/do-dynaRepeater.flow
>>> - http://localhost:8888/forms-samples/do-datasourceChooser.flow
>>> - http://localhost:8888/forms-samples/do-taskTree.flow
>>
>>
>>
>> <snip/>
>>
>>> Enjoy,
>>> Sylvain
>>
>>
>>
>> Well I have only just read this mail, and haven't had a chance to 
>> look at the samples, but it looks pretty useful to me.  I'll look 
>> into it soon.
>>
>> Nice one Silvain... I'm sure there are others that appreciate this 
>> effort.
>
>
> It looks really promising. I was not able to run the samples. Firefox 
> has rendered the retrieved list as text (outside selection widget). IE 
> just showed javascript error and did nothing.


Doh! I understand why you say "promising" :-(

I tested it successfully with Firefox 1.0 on MacOS and Windows and IE 6. 
The behaviour you describe with Firefox is what I had to fight a lot 
with: Node.importNode() effectively imports nodes, but that doesn't mean 
they're considered as HTML nodes, in which case only their text is 
displayed.

If you look at the new DOMUtils.importNode() in the new cforms.js, 
you'll see the quirks I used to workaround this weirdness: use ".xml" 
and ".innerHTML" properties with IE, and traverse the node tree for 
other browsers. I'm far from being a JS-on-browsers expert, so that may 
for sure not be the most "compatible" solution.

Is there something printed in Firefox's JS console, and what is the IE 
error?

Sylvain

-- 
Sylvain Wallez                        Anyware Technologies
http://apache.org/~sylvain            http://anyware-tech.com
Apache Software Foundation Member     Research & Technology Director


Mime
View raw message