Re: <al-for> help!

Gabriel Cooper <[email protected]> Thu, 27 Oct 2005 10:30:32 -0400
Newsgroups gmane.comp.web.albatross.general
Message-ID <[email protected]>

John Abel wrote:

> Hi!
>
> I'm hoping someone can point me in the right direction.  I have a  
> dictionary containing paths, and a description for each.  I have  
> assigned each to locals like so:
>
>     simpleCtx.locals.foundBooks = foundBooks
>     simpleCtx.locals.bookLinks = foundBooks.keys()
>
> I've then iterated on the list with this:
>
>             <al-for iter="book" expr="bookLinks">
>                 <tr>
>                     <td style="width: 15%;">Picture Will Go There</td>
>                     <td><a href='<al-value expr="book.value()">'><al- 
> value expr="foundBooks[ book.value() ]"></a></td>
>                 </tr>
>             </al-for>
>
> The odd thing, is the list loops twice, and then exits.  If I run the  
> cgi from the command line, it processes the entire list, and displays  
> them all ( as per below ).

The code looks fine to me. I'd suggest printing out bookLinks and 
foundBooks in <al-value> tags just before the for loop to make sure it 
was what you thought it was. Perhaps it was modified somewhere. This 
idea is reinforced by the fact that the code itself works in a 
controlled environment.

Hope this helps.

Gabriel.