cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leszek Gawron <>
Subject Re: JavaScript expressions in JXTG (was Re: svn commit: r325889)
Date Mon, 17 Oct 2005 19:07:15 GMT
Sylvain Wallez wrote:
> Leszek Gawron wrote:
>> Sylvain Wallez wrote:
>>> Actually, I'm more and more annoyed by Jexl: JXTemplate is the *only* 
>>> place in Cocoon where Jexl is used, and I would love to see it 
>>> replaced by JavaScript expressions. Script/expression language 
>>> consistency throughout Cocoon...
>> hmmm... we have touched the subject once. At the time you have pointed 
>> me with some javascript helper class to get the basics of rhino but I 
>> lost that message. Do you happen to remember what class it was?
>> This shouldn't be 'that' hard.
> Oh no, damn easy! See JavaScriptHelper in CForms.
> But the problem is elsewhere: what syntax will we use for JS expression 
> in JXTG. I would love to have it replace Jexl in "${}" expressions but 
> it ain't that easy as it will break all existing templates.
> We should have a configuration in the new JXTG that associates prefixes 
> of the "{" character to languages.
doh! that's already implemented in CTemplate:

<jx:out value="{jexl:expression}"/>
<jx:out value="{jxpath:expression}/>
<jx:out value="{default:expression}"/>

no more ${} and #{}. For default template language (you choose one in 
cocoon.xconf) that's as compact as you cant get : {expression}

so {js:expression} is just a matter of implementing a few interfaces.

Leszek Gawron                            
IT Manager                                         MobileBox sp. z o.o.
+48 (61) 855 06 67                    
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65

View raw message