if (RenderUtils.getViewState("candidacyDocuments") != null) {
RenderUtils.invalidateViewState("candidacyDocuments");
}
List<CandidacyDocumentUploadBean> candidacyDocuments = new ArrayList<CandidacyDocumentUploadBean>();
for (CandidacyDocument candidacyDocument : candidacy.getCandidacyDocumentsSet()) {
candidacyDocuments.add(new CandidacyDocumentUploadBean(candidacyDocument));
}
request.setAttribute("candidacyDocuments", candidacyDocuments);
request.setAttribute("candidacy", candidacy);
}