cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Johnston <>
Subject Re: Ajax - 'No handler found for element head' - 'No handler found for element body'
Date Fri, 21 Jul 2006 23:24:55 GMT
Andrew wrote:
> Hi,
> I have an ajaxified form which has a number of required fields. If you 
> submit the form without filling in any of the required fields 2 alert 
> are displayed. The first says 'No handler found for element head. Show 
> server response?', and the second alert says 'No handler found for 
> element body. Show server response?'. If you click yes to both questions 
> another window opens up showing your form page minus any of the form 
> fields! If all required fields are entered correctly then the form 
> submits as normal. What could be the issue here? When the page firtst 
> loads I get the following dojo debug lines:
> DEBUG: Loading URIresources/dojo/../forms/js/__package__.js
> DEBUG: Loading URIresources/dojo/../forms/js/common.js
> DEBUG: Loading URIresources/dojo/../forms/js/CFormsForm.js
> DEBUG: Loading URIresources/dojo/../ajax/js/BUHandler.js
> DEBUG: Loading URIresources/dojo/../ajax/js/insertion.js
> DEBUG: Loading URIresources/dojo/../forms/js/CFormsRepeater.js
> DEBUG: Loading URIresources/dojo/../forms/js/CFormsSuggest.js
> DEBUG: Loading URIresources/dojo/src/widget/html/ComboBox.js
> DEBUG: Loading URIresources/dojo/src/widget/ComboBox.js
> DEBUG: Loading URIresources/dojo/src/widget/html/stabile.js
> DEBUG: Loading URIresources/dojo/src/widget/InlineEditBox.js
> My sitemap is as follows:
>             <map:match pattern="**viewform-*.xml">
>                 <map:generate type="newjx" src="jx/{2}.jx"/>
>                 <map:transform type="browser-update"/>
>                 <map:transform type="cinclude"/>
>                 <map:transform type="xslt-saxon" src="style/{2}.xsl"/>
>                 <map:transform type="cinclude"/>
>                 <map:transform type="i18n">
>                   <map:parameter name="locale" value="en-US"/>
>                 </map:transform>
>                 <map:transform src="template-style/forms- 
> samples-styling.xsl"/>
>                 <map:transform type="i18n">
>                   <map:parameter name="locale" value="en-US"/>
>                 </map:transform>
>                 <map:select type="ajax-request">
>                   <map:when test="true">
>                     <map:serialize type="xml"/>
>                   </map:when>
>                   <map:otherwise>
>                     <map:serialize type="html"/>
>                   </map:otherwise>
>                 </map:select>
>             </map:match>


I think you need to understand how the AJAX publishing works, in 
particular the browser-update transformer.

When an AJAX request is received, the response to the browser should not 
be the entire document (that's not very AJAX-ey!), but only the parts 
that need to be updated in the DOM.  This is the job of the 
browser-update transformer; it filters out everything except elements in 
the "bu:" namespace (produced by the CForms JX macros), which the 
client-side JavaScript (Dojo) knows how to handle.

In your pipeline it looks like the browser-update transformer is 
executing, filtering out everything but the "bu:" elements which contain 
the form fields that need to be updated.  But then you pass it through 
some other transformation stages which *add* content back in!  All of a 
sudden you've got a document with much more than the "bu:" elements 
recognized by Dojo, so it pukes on those unrecognized elements.

I believe you need to restructure your pipeline so the browser-update 
transformer comes after the transforms that add content.

Hope that helps

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message