<c:forEach var="expData" items="${expenseDataList}">
<tr>
<td>
<div class="custom-control custom-checkbox">
<label><aui:input
cssClass="custom-control-input expense select-all"
type="checkbox" data-amount="${expData.expenseAmount}" data-expenseid="${expData.expenseId}"
id="expenseCheckbox" name="expenseCheckbox" label="" />
</label>
</div>
</td>
....
<td>
<c:forEach var="previewUrl1" items="${previewUrl}">
<aui:button icon=" icon-download-alt"
style="border:none; background-color: #1E47C2; color:white"
data-previewurl="${previewUrl1}" cssClass="download"
name="downloadButton" id="downloadButton" />
</c:forEach>
</td>
</tr>
</c:forEach>
I am using inside and It is creating 2 download button because I am iterating another near to download button.. I am getting the value inside previewUrl1 but it is creating 2 button as it is iterating twice because inside another
This is my portlet side code
long fileEntryId = 0L;
String previewURL = StringPool.BLANK;
List<String> s1=new ArrayList<String>();
try {
for (int i = 0; i < expenseDataList.size(); i++) {
fileEntryId = expenseDataList.get(i).getFileEntryId();
if (fileEntryId > 0) {
FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(fileEntryId);
previewURL = DLUtil.getPreviewURL(fileEntry, fileEntry.getFileVersion(), themeDisplay, StringPool.BLANK);
}
renderRequest.setAttribute("previewUrl", previewURL);
s1.add(previewURL);
LOG.info("File Entries"+fileEntryId);
LOG.info("Preview URl " + previewURL);
}
LOG.info(s1);
renderRequest.setAttribute("previewUrl", s1);
} catch (Exception e) {
e.printStackTrace();
}