permaculture playing cards
The moose likes Struts and the fly likes file upload within logic:iterate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "file upload within logic:iterate" Watch "file upload within logic:iterate" New topic

file upload within logic:iterate

Ilija Obucina

Joined: Nov 16, 2001
Posts: 6
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>
<B><logic:iterate ...<BR>
<html:file name="ReqDeliveryQtyForm" property="attachmentFile" styleClass="browse"/><BR>
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>
<B><logic:iterate ... indexId="idxLoc"><BR>
<html:file name="ReqDeliveryQtyForm" property='<%="attachmentFile" + idxLoc%>' styleClass="browse"/><BR>
My 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>
Can anybody share some ideas ??<BR>
Ilija Obucina
I agree. Here's the link:
subject: file upload within logic:iterate
It's not a secret anymore!