cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From H.vanderLin...@MI.unimaas.nl
Subject JXTemplate macro: how to create "return value"?
Date Wed, 01 Dec 2004 13:55:00 GMT
Hi guys,

I'm trying to create a jx:macro that does some processing and then stores
the result in a variable. I would like this macro to behave as a function,
i.e. pass the content of this variable to an external variable.

I've tried several approaches, but I don't get the result I want. Who can
help?

>From the dynamic repeater example I would assume that the following should
work, but it doesn't.

<jx:macro name="myMacro">
 <jx:parameter name="someParameter"/>
 <!-- do some processing -->
 <jx:set var="resultvar" value="${processingresult}"/>
 <jx:evalBody/>
</jx:macro>


<jx:set var="getResult" value="blah"/>
<myMacro someParameter="somevalue"/>
<jx:set var="getResult" value="${resultvar}"/>
</myMacro>

<p>${getResult}</p>

I would expect this to display the result of the macro, but it displays
"blah".

Any idea?

Thanks.

Bye, Helma

Mime
View raw message