users@jsf-extensions.java.net

Parse Error with ajaxZone

From: noah <iamnoah_at_gmail.com>
Date: Thu, 15 Feb 2007 11:50:14 -0600

Setup: 1.2 RI + Facelets + Facelets el jars on Tomcat 5.5 w/ source
checked out this morning

Snippet:

<h:form id="form">
 <jsfExt:ajaxZone>
  #{someBean.foo}
  <h:commandButton action="#{someBean.foo}" id="foo"/>
 </jsfExt:ajaxZone>
</h:form>

The foo action increments the foo property.

Anyhow, clicking on the button results in a Javascript error
("components has no properties") and no screen refresh. However, if I
refresh foo has been incremented.

I set a breakpoint with firebug and saw that there was a parse error
for the response xml. It looks like the problem is nested CDATA. The
full responseText is below.

I also set a breakpoint in EscapeCDATAWriter, and noticed that it only
gets called 3 times, with the strings:
"\n"
"\nvar curZone = null;\n"
"\nDynaFacesZones.ajaxifyChildren($('j_id7'), { });\n"

So it looks like whatever is writing the rest of the content of markup
is bypassing the EscapeCDATAWriter. I can't figure out where that is
happening though. Any ideas?

I'd be happy to patch this if someone can give me a push in the right direction.

The xml response I get is:

<partial-response><components><render
id=\"j_id7\"><markup><![CDATA[<div id=\"j_id7\">\n
foo=0\n<script type=\"text/javascript\"
language=\"Javascript\">\n//<![CDATA[\nfunction dpf(f) {var adp =
f.adp;if (adp != null) {for (var i = 0;i < adp.length;i++)
{f.removeChild(adp[i]);}}};function apf(f, pvp) {var adp = new
Array();f.adp = adp;var ps = pvp.split(',');for (var i = 0,ii = 0;i <
ps.length;i++,ii++) {var p = document.createElement(\"input\");p.type
= \"hidden\";p.name = ps[i];p.value = ps[i +
1];f.appendChild(p);adp[ii] = p;i += 1;}};function jsfcljs(f, pvp, t)
{apf(f, pvp);if (t) {f.target =
t;}f.submit();dpf(f);};\n//]]>\n</script>\n<a href=\"#\"
onclick=\"if(typeof jsfcljs ==
'function'){jsfcljs(document.forms['j_id5'],'j_id7:j_id9,j_id7:j_id9','');}return
false\">foo?</a><script language=\"javascript\"
type=\"text/javascript\">\n//<![CDATA[\n\nvar curZone =
null;\n\nDynaFacesZones.ajaxifyChildren($('j_id7'), {
});\n//]]>\n</script></div>]]></markup></render></components><state><![CDATA[j_id1:j_id4]]></state></partial-response>"