Re: passing a list for macro

Daniel Dekany <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
Tuesday, April 15, 2008, 3:50:50 PM, howlerbr wrote:

> I have the following macro code:
>
> <#macro tpl_columnHeader columns>
>         <columnHeader>
>                 <band height="31" isSplitAllowed="true">
>                         <#assign x = 0>         
>                         <#list columns as column>                  
>                                 <staticText>
>                                         <reportElement
> mode="Opaque" x="${x}" y="1" width="${column.width}"
> height="30" key="staticText-${column_index}" forecolor="#ffffff"
> backcolor="#bbbbbb"/>
>                                         <box topBorder="None"
> topBorderColor="#000000" leftBorder="None"
> leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000"
> bottomBorder="None" bottomBorderColor="#000000"/>
>                                         <textElement textAlignment="Center">
>                                                 
>                                         </textElement>
>                                        
> <text><![CDATA[${column.display}]]></text>
>                                 </staticText>
>                                 <#assign x = x + column.width>
>                         </#list>                
>                 </band>
>         </columnHeader>
> </#macro>               
>
> I'm trying to call it using:
>
> <@tpl_columnHeader columns=columList/>
>
> where columnList is a List of Column object but it's not working.

OK, I think I will kill myself or something... Because, it's simply
"not working", again!!! Where Is The ERROR MESSAGE??? Now really, are
there some popular frameworks that hide the error messages and just
print "rendering failed" or something, or what's going on? /-:

> The columnList is passed from my Java class:
>
> params.put("columnList", columnList);
>
> Is that possible to do what I want? What is the correct syntax???

That is the correct syntax as far as I see at the first and very fast
glance... but I'm surely will not look at it more closely if an error
message doesn't tell where to look.

> Thanks,

-- 
Best regards,
 Daniel Dekany


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.