Hi, The Foreach can call your class with the "current" index and set it. The "getters" use that value to return the "current" value for each list.
HTH, Mark Mark J. Stang Senior Engineer/Architect office: +1 303.468.2900 mobile: +1 303.507.2833 Ping Identity -----Original Message----- From: Darío Vasconcelos [mailto:[EMAIL PROTECTED] Sent: Wed 2/21/2007 2:43 PM To: Tapestry users Subject: Foreach, iterate over several collections at once Hi, I'm trying to solve a problem that might be trivial in JSP, but I can't find a way to do it in Tapestry without some collection munching in Java. My problem is that I have three ArrayLists that hold very similar information, and need to be displayed inside the same table. To explain this better, let me draw a simple diagram: HeaderRow1 list1 list2 list3 HeaderRow2 list2 list2 list3 HeaderRow3 list3 list2 list3 That is, List1 contains a HashMap with two elements: HeaderRow1 and the value for List1. List2 contains also a HashMap with twoelements, HeaderRow1 and list2. The same applies to List3. I'm thinking on using a Foreach for this, but it will only iterate over one of the lists, and I **really** need this data to be in the same table. Of course, more than just one column per list needs to be displayed, my example is a simplification. The obvious solution is to create a getJoinedTable() method and join the three collections into one big ArrayList, but the code isn't nice, and since I need to do this for several other pages, the picture is not very nice. What puzzles me is that the solution to this problem in JSP would be soooo simple!! There has to be a "Tapestried" way to do it... Regards, Dario -- A zygote is a gamete's way of producing more gametes. This may be the purpose of the universe. - Robert A. Heinlein --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]