Title: iterate header/footer
I'm not sure I understand:
 
the "bean" object does not live outside the scope of the iterate tag so the present tag can't go there.
Inside the iterate tag, the present tag would evaluate once per iterate loop and print the header multiple times - which defeats the purpose.
 
Can you give me a working example of what you mean?  Am I misunderstanding something?
-----Original Message-----
From: Jeff Trent [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 14, 2001 7:19 PM
To: [EMAIL PROTECTED]
Subject: Re: iterate header/footer

Mike,
 
You should use the <logic:present ...> Tag.  For example:
<logic:present name="org.apache.struts.action.ERROR">
<...table header...>
</logic:present>
 
See the mail archives for more info.
 
----- Original Message -----
Sent: Monday, May 14, 2001 8:17 PM
Subject: iterate header/footer

The main issue I have with the logic:iterator tag is the lack of support for iteration headers/footers.  Is there some sort of support for this currently that I've missed?  I'm talking about this:

<logic:iterate ... id="bean">
        <logic:header>
                <table>
                <tr><th>Name</th></tr>
        </logic:header>
        <tr><td><bean:write name="bean" property="name"/></td></tr>
        <logic:footer>
                </table>
        </logic:footer>
</logic:iterate>

This would prevent any HTML from being generated if the collection is empty.

I tried using the greaterThan tag but it does not support the Collection.size() property (since it's not a proper bean property name).  Any suggestions as to how best to put this into Struts?  Is the header/footer tag a good or bad idea and why?

Mike

Reply via email to