cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno Dumon <br...@outerthought.org>
Subject Re: svn commit: r325889 - /cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/generation/jx-macros.xml
Date Mon, 17 Oct 2005 15:06:32 GMT
On Mon, 2005-10-17 at 16:50 +0200, Leszek Gawron wrote:
> bruno@apache.org wrote:
> > Author: bruno
> > Date: Mon Oct 17 06:24:48 2005
> > New Revision: 325889
> > 
> > URL: http://svn.apache.org/viewcvs?rev=325889&view=rev
> > Log:
> > Convert some Jexl expressions to JXPath so that they work also when used without
javascript-flow.
> > 
> > Modified:
> >     cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/generation/jx-macros.xml
> > 
> > Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/generation/jx-macros.xml
> > URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/generation/jx-macros.xml?rev=325889&r1=325888&r2=325889&view=diff
> > ==============================================================================
> > --- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/generation/jx-macros.xml
(original)
> > +++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/generation/jx-macros.xml
Mon Oct 17 06:24:48 2005
> > @@ -87,7 +87,7 @@
> >        <jx:if test="${cformsHelper.pushRepeater(id, false)}">
> >          <jx:set var="repeater" value="${cformsHelper.peekWidget()}"/>
> >          <jx:forEach varStatus="repeaterLoop" begin="0" end="${repeater.getSize()
- 1}">
> > -          <jx:if test="${cformsHelper.pushContainer(java.lang.Integer.toString(repeaterLoop.index))}">
> > +          <jx:if test="#{pushContainer($cformsHelper, java.lang.Integer.toString($repeaterLoop/index))}">
> I do not get it: why do you think this change is necessary? Does it 
> break when used with JEXL ?

It breaks when the template is not executed via a sendPage call from
rhino flowscript (e.g. from an apple, or a directly called pipeline).

This is because jexl in itself does not allow to call static methods
like java.lang.Integer.toString. The "java" is a special variable
inserted into the jexl context by the jx template generator, and is only
available when called from flow (since it is a rhino object). It would
be possible to make something equivalent for when not using rhino, but
the above is a quicker solution.

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


Mime
View raw message