Re: Iterate a Set of data

Geeth Lochana <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
order mean , what i put in the out put. it's not like that afetr run it.
if the first record is totalVariance, and second record is factor in the collection.
the output like as below.
                     <totalVariance> 
                             <risk>12.32</risk> 
                     </totalVariance> 
                    <factor> 
                        <risk>12.32</risk> 
                     </factor> 
                     <specific> 
                         <risk>12.32</risk> 
                     </specific> 


But i need the order of what i put in the template.



Best Regards,
Geeth,
Mobile : +94 77 355 0798


________________________________
From: Daniel Dekany [via FreeMarker] <[email protected]>
To: Geeth Lochana <[email protected]>
Sent: Saturday, September 24, 2011 1:02 PM
Subject: Re: Iterate a Set of data


What ordering are you expecting? The order of the riskSummaryRepors 
will be the same as the Set gives them to FreeMarker. 


Friday, September 23, 2011, 2:20:42 PM, Geeth Lochana wrote: 


> I have collection of data, record as like follows. 
> Class RiskSummaryRpt{ 
>     private String name; 
>     private String value; 
>  } 
> 
> Class Report{ 
>     private Set<Abc> riskSummaryRpt; 
> } 
> 
> i want to get following out put using freemarker template 
> 
> using above collection i want to get single record. 
>   
> this is the current template i have         
> <#list report.riskSummaryRpt as param> 
>                 <#if param.name == 'Factor'>           
>                     <factor> 
>                         <risk>${param.riskVal!""}</risk> 
>                     </factor> 
>                 <#elseif param.name == 'Stock Specific'>           
>                     <specific> 
>                        <risk>${param.riskVal!""}</risk> 
>                     </specific> 
>                 <#elseif param.name == 'Total'>           
>                     <totalVariance> 
>                          <risk>${param.riskVal!""}</risk> 
>                     </totalVariance> 
>                 &lt;/#if&gt; 
>         &lt;/#list&gt; 
> 
> i need to get following output with correct order of tags. 
>                     <factor> 
>                         <risk>12.32</risk> 
>                     </factor> 
>                     <specific> 
>                         <risk>12.32</risk> 
>                     </specific> 
>                     <totalVariance> 
>                         <risk>12.32</risk> 
>                     </totalVariance> 
> 
> 
> but i couldn't get the order is mismatch. 
> Any one have any idea to over come this issue. 
-- 
Best regards, 
 Daniel Dekany 


------------------------------------------------------------------------------ 
All of the data generated in your IT infrastructure is seriously valuable. 
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense. 
http://p.sf.net/sfu/splunk-d2dcopy2
_______________________________________________ 
FreeMarker-user mailing list 
[hidden email] 
https://lists.sourceforge.net/lists/listinfo/freemarker-user


________________________________
 
If you reply to this email, your message will be added to the discussion below:http://freemarker.624813.n4.nabble.com/Iterate-a-Set-of-data-tp3836641p3838859.html 
To unsubscribe from Iterate a Set of data, click here.

--
View this message in context: http://freemarker.624813.n4.nabble.com/Iterate-a-Set-of-data-tp3836641p3841589.html
Sent from the freemarker-user mailing list archive at Nabble.com.

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1

_______________________________________________
FreeMarker-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freemarker-user
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.