cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
Subject Re: [cforms] fi:validation-errors in AJAX mode
Date Tue, 02 Aug 2005 14:14:25 GMT
Jason Johnston wrote:

> Sylvain Wallez wrote:
>
>> Ugo Cei wrote:
>>
>>> Looks good to me. AFAIK, Ajax support works only with the template 
>>> macros, so it might not make sense to add this feature to the 
>>> transformer also. What is the orientation of the community towards 
>>> the transformer/macros ambiguity? I'd like to have just one 
>>> recommended implementation of this, so if macros are the way to go, 
>>> what about deprecating the forms transformer? 
>>
>>
>> Well, macros are more powerful because they allow to do more than 
>> templating with the widgets. A straightforward example is conditional 
>> templating, e.g. displaying "There are now contacts" rather than an 
>> empty table. This is not possible with a transformer, unless we add 
>> an expression language and some control structures which will make it 
>> yet another programming-language-in-XML...
>>
>> OTOH, the transformer is useful when JXTG is not a option e.g. when 
>> the generator is an XSP...
>
>
> IIUC you can also use JX as a transformer, so wouldn't that cover this 
> case?


Because you should really avoid using JXTransformer if you want a 
responsive application: this transformer basically feeds the JX 
generator with the incoming SAX stream, meaning the template is full 
reparsed and recompiled at each execution, which is highly inefficient.

IMO, we should make this very prominent in the doc and discourage such 
usage, or even deprecate this transformer.

> Anyway... to Ugo's question, I believe (correct me if I'm wrong) that 
> AJAX works regardless of whether the template is interpreted by JX or 
> the FormsTemplateTransformer, since it's the widgets themselves that 
> signal whether or not they have been updated by wrapping their SAX 
> output in a <bu:replace>.


Exactly.

> Personally I usually use FormsTemplateTransformer for most forms, 
> unless I know for sure I'm going to need the extra expressive power of 
> JX. Mostly because I'm too lazy to jx:import the forms macros resource 
> in every template.


Hmm... the import is just a ctrl-c/ctrl-v away. Wow, this *is* lazyness :-)

Sylvain

-- 
Sylvain Wallez                        Anyware Technologies
http://people.apache.org/~sylvain     http://www.anyware-tech.com
Apache Software Foundation Member     Research & Technology Director


Mime
View raw message