java - nested forEach loop JSTL issue -
i'm making calendar using jstl , ran issue there can more 1 item per day....
i'm attempting use nested foreach loop work out there duplicate data occurring because of nested foreach loop.
here code:
<div id="calendar_item_meta"> <c:foreach var="calendaritemmeta" items="${inboxcalendar.mapcalendar}" varstatus="status"> <c:set var="calendaritemcounts" value="${fn:length(calendaritemmeta.value[0].mailitemspayable)}"/> <c:set var="calendarmappingmemoholder" value="${calendaritemmeta.value[0].mailitemspayable[status.index].billinfo.memo}"/> <c:set var="calendarmappingamountholder" value="${calendaritemmeta.value[0].amount}"/> <div id="item_${calendaritemmeta.key}"> <c:if test="${calendaritemcounts > 0}"> <c:foreach var="i" begin="0" end="${calendaritemcounts}" step="1" varstatus ="status5"> <c:set var="calendarmappingitemholder" value="${calendaritemmeta.value[0].mailitemspayable[i].billinfo.presacctid.billerinfo.name}"/> <p><strong>${inboxcalendar.currentmonth} ${calendaritemmeta.key}</strong> ${calendarmappingitemholder}</p> </c:foreach> <c:if test="${calendarmappingamountholder != null}"> <p>${calendarmappingamountholder}</p><br> </c:if> <c:if test="${calendarmappingamountholder != null}"> <p>${calendarmappingmemoholder}</p> </c:if> </c:if> </div> </c:foreach> </div> the date shows twice data inside second foreach loop.. how can around this?
Comments
Post a Comment