i want to fill a field of mandatoryList that its name is uploadFile.
but every time i set new upload field in list, last uploadFiles destroyed and set with intial value.




public void valueUploadFile(ValueChangeEvent valueChangeEvent) throws WorkflowException,
SQLException,
IOException {



UploadedFile data = (UploadedFile)valueChangeEvent.getNewValue();

if (!inputFileUpload.equals("-1")) {

String selectedLoanDocumentID =
Helper.getSelectedLoanDocumentRowID(this.mandatory Tbl, "ID");
for (LoanDocument ld : mandatoryList) {
if (ld.getID().equals(new BigDecimal(selectedLoanDocumentID))) {
ld.setUploadedFile(data);
}
}
} else {
Helper.showMessage(null, FacesMessage.SEVERITY_ERROR,
Helper.getResourceBoundle("view.ViewController_Eme rgencyBundle").getString("ER.sqlExceptionFile.labe l"));
}


for (LoanDocument l : mandatoryList) {
System.out.println(l.getUploadedFile().getLength() );
}

}