velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Douglass" <r.dougl...@onlinehome.de>
Subject macros calling macros
Date Fri, 03 Oct 2003 21:11:32 GMT
I'm really sorry if the answer to this is in the mail archive, but I
couldn't find it.

#macro( hyperlink $hyperlinkId)
####### THIS SET DOESN'T WORK WHEN CALLED FROM NAVIGATION
#set($linkDoc = $dataBase.getDocument($hyperlinkId))
$linkDoc
#end

#macro( navigation $widgetId)
#set($navdoc = $dataBase.getDocument($widgetId))
#set($hyperlinks = $navdoc.applyDocumentPath('Hyperlinks'))
#foreach( $link in $hyperlinks )
#hyperlink($link.getIdValue())
#end
#end

I call #hyperlink from within #navigation. The variable $hyperlinkId and the
variable $dataBase are both right, but the line #set($linkDoc =
$dataBase.getDocument($hyperlinkId)) doesn't result in a method call. When I
call hyperlink directly, it works fine. Is can't be a type-conversion
problem -- getDocument(String id) -- as I use the same syntax elsewhere, so
I figure it must be a scoping/context problem. I've read the documentation,
and I've been on and off of this list for half a year, but alas, I just
don't understand.

Thanks in advance,

Robert Douglass


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message