• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

file upload within logic:iterate

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
In the struts applications that I am working on we have requirements to allow user<BR>
to upload multiple files at once. This could look like following:<BR>
<P>
<B><logic:iterate ...<BR>
......<BR>
<html:file name="ReqDeliveryQtyForm" property="attachmentFile" styleClass="browse"/><BR>
...<BR>
</logic:iterate
</B></P>
The problem here is that property name can not be shared. It can be for all other<BR>
html tags but not for a html:file. In order to make this work I am doing something like:<BR>
<BR>
<B><logic:iterate ... indexId="idxLoc"><BR>
.....<BR>
<html:file name="ReqDeliveryQtyForm" property='<%="attachmentFile" + idxLoc%>' styleClass="browse"/><BR>
...<BR>
</logic:iterate><BR>
<BR></B>
My ActionForm.java will have getAttachmentFile1(), getAttachmentFile2() and so on. <BR>
This is still not generic solution since I have to have all get/set methods defined, but in this scenario they<BR>
should be "dynamic". My current application has a limit of 10 iterations since I have defined 10 of <BR>
these get/set methods.<BR>
<BR><BR>
Can anybody share some ideas ??<BR>
Regards,
Ilija Obucina
reply
    Bookmark Topic Watch Topic
  • New Topic