Re: [Freemarker-devel] access data LinkedHashMap.LinkedHashMap

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: [Freemarker-devel] access data LinkedHashMap.LinkedHashMap

Daniel Dekany
This is freemarker-user mater, not freemarker-devel, so I have moved
this over there.

Anyway... seems trRS is not a List in the data-model, but a Map. Also
you can't list a Map, only its keys or values (like
<#list myMap?keys as key>). However, there's a limitation that it will
work like that if the keys are strings, not integers. I'm not sure if
you really need a LinkedHashMap with integer keys, or a just a List.

--
Thanks,
 Daniel Dekany


Monday, June 17, 2013, 11:45:04 AM, larosagiorgio wrote:

> Hi,
> i would like access to this class Java (resultSet of Smooks):
>
> List
>    -LinkedHashMap (in position 0 of List)
>         -LinkedHashMap
>
> How may0 access this structure by Freemaker?
> I tryed with this template, but nothing.
>
> <#list trRS[0] as keys>
> <#list keys as keys2> ${keys[keys2]} -->retrieve the value of child
> LinkedHashMap
> </#list>--> for ciclyng keys of child LinkedHashMap!!!
> </#list>--> for ciclyng keys of my first LinkedHashMap!!!
>
> trRS is my List.
> trRS[0] is my first LinkedHashMap...here freemakers throw error:
>
> Expected collection or sequence. trRS[0] evaluated instead to
> freemarker.template.SimpleHash on line 2, column 24 in free-marker-template.
> The problematic instruction:
> ----------
==>> list trRS[0] as keys [on line 2, column 17 in free-marker-template]

> ----------
>
> Java backtrace for programmers:
> ----------
> freemarker.template.TemplateException: Expected collection or sequence.
> trRS[0] evaluated instead to freemarker.template.SimpleHash on line 2,
> column 24 in free-marker-template.
>        
>
> Thanks for your help!!!I hope.
>  
>
>
>
> --
> View this message in context:
> http://freemarker.624813.n4.nabble.com/access-data-LinkedHashMap-LinkedHashMap-tp4654600.html
> Sent from the freemarker-devel mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Windows:
>
> Build for Windows Store.
>
> http://p.sf.net/sfu/windows-dev2dev
> _______________________________________________
> FreeMarker-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/freemarker-devel
>

--
Thanks,
 Daniel Dekany


------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
FreeMarker-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-user