cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grzegorz Kossakowski <gkossakow...@apache.org>
Subject Re: Presumed bug in Dojo/Cocoon integration
Date Fri, 25 May 2007 15:07:02 GMT
Dev at weitling pisze:
> Hi,
> 
> (this is a repost of a mail to the users mailing list)
> 
> messing around with some presumed bugs in my application for the last
> week I finally think the bug is in the Dojo/Ajax/(X)HTML integration in
> Cocoon 2.1.10.
> The problem: If I use Ajax in my Form and serialize it as html then on
> action (pressing the "Add answer"- or trash-button) the table layout
> becomes very ugly. If I serialize to xhtml it looks perfect but every
> action performs a full page reload because Ajax doesn't work.
> 
> I would be glad if anyone could have a look on my app (you'll find it
> along with the screenshots at www.weitling.net/Zip4Cocooners.zip)
> and confirm this behaviour. Correcting the bug
> in Dojo/Cocoon/whatever would be even greater :-)

Florian, I'm not sure why the table becomes ugly but my wild guess is that your quite complex
setup of repeaters hits some obscure bug or 
just hits limits of AJAX approach itself and you would need to invent some kind of hack to
avoid this. I may be wrong and it could be 
Cocoon's fault, though. What I suggest to do is to come with simpler setup of repeaters and
simpler table where the problem still occurs so 
you (and maybe others) could tackle the problem more easily.

As for serializing to XHTML. First of all you must be aware that browsers will not treat XHTML
as XHTML pages because of content type set to 
"text/html" instead of "text/xhtml". It is done so because IE (sigh) does not understand "text/xhtml".
Given that, browsers interpret XHTML 
as HTML code and it usually works but not for empty elements because in html there was no
such a construct
<script src="..."/>

We are finally near to the problem, AJAX does not work because js-libraries are not being
loaded correctly because script tag is not parsed 
correctly. As a workaround, you can add comment/dummmy character inside all empty elements
in resulting XHTML. It's really basic tip.

There were lots of discussions related to this issue so maybe you can find some neat solution
in archives. Some pointers:
http://thread.gmane.org/gmane.text.xml.cocoon.user/58517
http://thread.gmane.org/gmane.text.xml.cocoon.user/34237

And this especially interesting for you:
http://thread.gmane.org/gmane.text.xml.cocoon.user/60301

I hope that this helps you a little.

-- 
Grzegorz Kossakowski
http://reflectingonthevicissitudes.wordpress.com/

Mime
View raw message