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 14:02:55 GMT
Sylvain Wallez wrote:
> Jason Johnston wrote:
>> On Mon, 2005-08-01 at 16:38 +0200, Sylvain Wallez wrote:
>>>> ? The <fi:validation-errors> element is  described here:  
>>>> errors
>>> Yes, sure. Where I'm lost is about knowing *what* produces this 
>>> fi:validation-errors element (it's not a widget, isn't it?). I never 
>>> used it, and a quick search did not revealed how it is produced.
>> You are correct, it is not "produced" by anything besides the template
>> author.  It's simply a styling hint, much like fi:group, which is
>> handled entirely by the XSLT.
> Ok, I see.
>> Unfortunately this means that it is never included in the AJAX browser-
>> update XML since there's nothing to ensure it's wrapped in a <bu:update>
>> element.  (Hmm, would manually wrapping it in a <bu:update> in the
>> template do the trick?  I wonder.
> Yes, wrapping it with a <bu:update> would definitely update it. But that 
> would occur at each and every form roundtrip.

I see.  So I guess that would make it so that you could never exit AJAX 
mode, since there would always be at least one <bu:replace> in the 
returned XML!  Yikes.

>> I think there's a definite usefulness in having it
>> AJAX-enabled, so perhaps it needs to be handled further upstream, e.g.
>> in FormsTemplateTransformer.  Should it become an ft-namespaced element
>> instead like <ft:validation-errors id="someId" />?  Thoughts?  I'm
>> willing to take a whack at putting together a patch, with guidance.
> AFAIU its purpose, that would be a widget that collects validation 
> errors from a set of other widgets. Its validate() method would check 
> the if the collected validation errors have changed, and if yes trigger 
> the page refresh.

So you're suggesting to actually make it a widget, as in 
fd:validation-errors, rather than just a template element?  That's an 
interesting idea... I think I'd rather keep it limited to the templating 
layer though, since it's really a presentation concern.

View raw message