Hi Jason,
question? Why will the ajax process only be initiated with:

<input type="submit" id="save" value="Submit" />

and not:

<a href="" ()"></a> ?

When the _javascript_ methodology to submit a page is used, the whole page reload!

regards

Andrew

On 22/07/06, Andrew <[EMAIL PROTECTED]> wrote:
Jason,
Eureka! At last I have ajax working with my forms!!!!

Many thanks for pointing me in the right direction.

regards

Andrew


On 22/07/06, Jason Johnston <[EMAIL PROTECTED]> wrote:
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="">>                 <map:transform type="browser-update"/>
>                 <map:transform type="cinclude"/>
>                 <map:transform type="xslt-saxon" src="">>                 <map:transform type="cinclude"/>
>                 <map:transform type="i18n">
>                   <map:parameter name="locale" value="en-US"/>
>                 </map:transform>
>                 <map:transform src=""> > 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>

Andrew--

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





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to