Re: multiple collections for list directive
Daniel Dekany <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
Wednesday, February 24, 2010, 12:31:19 PM, Daniel Dekany wrote:
> Wednesday, February 24, 2010, 6:36:56 AM, bhushan2005 wrote:
>
>> Hi,
>>
>> I have to output something like this
>>
>> <table>
>> <tr>
>> <td> val1 </td> <td> val2 </td>
>> </tr>
>> </table>
>>
>> where val1 and val2 are coming from 2 seperate ArrayLists.
>>
>> How can i implement this using the list directive or by any other means in
>> freemarker
>
> Use the indices directly, not the list directive. (Or write a
> TemplateSequenceModel implementation that packs the related elements
> together... but that's Java programming already.)
Or, if you need this often, write a macro for it:
<@list_parallel arr1, arr2; i1, i2>
${i1} and ${i2}
</@list_parallel>
To implement the list_parallel macro purely in FTL, you could use
indices...
>> Thanks in advance :)
>
--
Best regards,
Daniel Dekany
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev