You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Dev at weitling <de...@weitling.net> on 2007/05/24 13:25:15 UTC

Presumed bug in Dojo/Cocoon integration

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 :-)

Greetings,
Florian



Re: Presumed bug in Dojo/Cocoon integration

Posted by Ellis Pritchard <el...@nukinetics.com>.
On 25 May 2007, at 16:07, Grzegorz Kossakowski wrote:

> 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
>

See also: http://www.hixie.ch/advocacy/xhtml - Sending XHTML as text/ 
html Considered Harmful

Ellis.


Re: Presumed bug in Dojo/Cocoon integration

Posted by Grzegorz Kossakowski <gk...@apache.org>.
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/

Re: Presumed bug in Dojo/Cocoon integration

Posted by Grzegorz Kossakowski <gk...@apache.org>.
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 busy with my maths work, now. I'll try to take a look at this on Friday evening.

-- 
Grzegorz Kossakowski