He said an Arraylist of Hashtables so..$manager.underlings is probably a hashtable..if so try
foreach needs somthing that implements the Collection interface (if i'm not mistaken ;) $manager.underlings.keySet() or $manager.underlings.entrySet() and go from there... hope that helps... Saimon > -----Mensaje original----- > De: Geir Magnusson Jr. [SMTP:[EMAIL PROTECTED]] > Enviado el: viernes 26 de abril de 2002 16:22 > Para: [EMAIL PROTECTED] > Asunto: Re: Nesting foreach > > On 4/26/02 10:04 AM, "Emyr James" <[EMAIL PROTECTED]> wrote: > > > I have an Arraylist of hashtables. Some of the objects in the hashtables > are > > themselves arraylists. > > Suppose I was doing a page to display a company salary with 2 levels. > Each > > person > > would have various attributes like Name, Salary, Joining date etc. They > would > > also > > have a list of underlings, which would be empty for those on the lowest > level. > > > > I want to do something like.. > > > > <table> > > #foreach ($manager in $managers) > > <tr><td>$manager.name</td> > > <tr><td><ul> > > #foreach($underling in $manager.underlings) > > <li>$underling.name</li> > > #end > > </ul></td></tr> > > #end > > </table> > > > > But the line #foreach($underling in $manager.underlings) doesn't seem > to do > > the > > right thing. > > Anyone have any ideas? > > That should work just fine. > > What is a $manager? What does $manager.underlings return? > > -- > Geir Magnusson Jr. [EMAIL PROTECTED] > System and Software Consulting > The question is : What is a Mahnamahna? > > > -- > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
