I have Set responseDocumentsVar in my view and it holds three values. For instance, PASPGP_CND,COVER_LTR,PERMIT_LTR. I used this variable in my xhtml and iterated using primesfaces component p:repeat as shown below. However the unexpected behavior is when I try to access "PASPGP_CND" letter, COVER_LTR is downloaded and when I try to access PERMIT_LTR ,PASPGP_CND is downloaded. Not sure why, what I access is not downloaded. Could anyone explain this behavior ?
<p:repeat value="#{sessionView.appCycleEntity.reviewResponseEntity.reviewResponseDocuments.toArray()}"
var="revResDocument"
width="100%" styleClass="hideDataTableColumnsHistory">
<div class="cardWrapper ui-g-12 ui-md-6 ui-lg-6">
<div class="cardDisplay fileCard">
<div class="cardTypeId">
<div class="icon"></div>
</div>
<div class="cardInfo">
<!-- card meta data -->
<dl class="cardMetaData clearfix">
<dt>
<p:commandLink id="filename${fileTypeCounter}_${fileCounter}"
value="#{sessionView.getLetterNameForSummaryScreen(revResDocument.letterTypeCode).length() gt 30 ? sessionView.getLetterNameForSummaryScreen(revResDocument.letterTypeCode).substring(0,30).concat('...') : sessionView.getLetterNameForSummaryScreen(revResDocument.letterTypeCode)}"
actionListener="#{recordDecisionController.retrieveLetter(revResDocument)}"
ajax="false" process="@this" onstart="PF('statusDialog').show()"
oncomplete="PF('statusDialog').hide();" immediate="true"/>
</dt>
</dl>
</div>
</div>
</div>
</p:repeat>
In above image when I try to access 1, 3 is download and when I try to access 3, 2 is downloaded i.e. desired file not downloaded. I debugged on the java side, the attachment id passed to backend is also not correct.
I am sorry if I was not clear in explaining the question.