Hi Antonio,

you cannot iterate over a Map as it does not implement Collection. Try the 
Map´s methods .values() or .entrySet() and iterate over their return values. 
For further information look here: 
http://java.sun.com/javase/6/docs/api/java/util/Map.html

Regards nillehammer

----- original Nachricht --------

Betreff: loop in a TreeMap
Gesendet: Do, 26. Jun 2008
Von: Antonio Ordoñez<[EMAIL PROTECTED]>

> Hi all,
> 
> I'm trying to iterate in a TreeMap in my template
>                     <tr t:type="loop" t:source="allMenuOption" 
> t:value="menuOption">
>                         <td>
>                             ${menuOption.name}
>                         </td>
>                     </tr>
> 
> In the class:
>     public TreeMap<String, MenuOption> getAllMenuOption(){
>         return this.menuOptionMap;
>     }
> 
> And I obtain the following mistake:
> Property 'menuOption' of class com.packtpub.celebrities.components.Menu 
> (within property expression 'menuOption.name') is not readable (it has 
> no read accessor method).
> 
> Could anybody explain to me how must I iterate in a TreeMap.
> 
> It works correctly if I try to iterate in a List but not with a TreeMap.
> 
> Thank you very much.
> 
> Greetings.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

--- original Nachricht Ende ----


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to