cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Johnston <>
Subject Re: [cforms] fi:validation-errors in AJAX mode
Date Tue, 02 Aug 2005 16:39:09 GMT
On Tue, 2005-08-02 at 18:32 +0200, Sylvain Wallez wrote:
> Jason Johnston wrote:
> >On Tue, 2005-08-02 at 16:57 +0200, Sylvain Wallez wrote:
> >  
> >
> >>Nono, this is smarter than that! An Ajax request is identified by the 
> >>special "cocoon-ajax" parameter. If this parameter is not present, the 
> >>BUTransformer simply remove the bu:replace elements. This is what allows 
> >>the same processing chain (except the final serializer) to be used for 
> >>Ajax and non-Ajax requests.
> >>    
> >>
> >Right, I meant that when the javascript makes an AJAX request (with the
> >cocoon-ajax header set), it checks the response for the existence of any
> >bu:replace elements, and if none are present it allows the HTML to
> >submit the form normally so the flow can continue.  But if you were to
> >manually insert a bu:replace in the template, that would mean that the
> >response to each AJAX request would always contain that bu:replace, so
> >you'd never get the empty document.
> >  
> >
> The full page reload is triggered by a special "X-Cocoon-Ajax: continue" 
> header. Reacting to an empty document would not work, as there are some 
> event listeners that do nothing. For example, we may want to check the 
> validity of an input as soon as it's entered. If the input is valid, 
> nothing special happens and the returned document is empty.

OK, I get it now.  Thanks for taking the time to explain it; I'm new to
all this and I thought I understood how it worked but obviously not.
This knowledge will definitely help with the patch I'm working on.

This is all *great* stuff, BTW. :-)

View raw message