iterate header/footer

2001-05-14 Thread Perham, Mike
Title: 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
  trthName/th/tr
 /logic:header
 trtdbean: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





Re: iterate header/footer

2001-05-14 Thread Jeff Trent
Title: 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 - 
  From: 
  Perham, Mike 
  
  To: '[EMAIL PROTECTED]' 
  
  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 
   
   trthName/th/tr 
   /logic:header 
   trtdbean: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