private void populatePMHFromGrid(RACPPastMedicalHistoryVo pastMedicalHistoryVo) { RACPRelevantDiagnosisListCollection collRACPRelevantDiagnosisList = new RACPRelevantDiagnosisListCollection(); for (int i = 0; i < form.grdPMH().getRows().size(); i++) { grdPMHRow row = form.grdPMH().getRows().get(i); if(row.getcolSelect()) collRACPRelevantDiagnosisList.add(row.getValue()); } if(collRACPRelevantDiagnosisList.size()>0) pastMedicalHistoryVo.setRelevantDiagnosis(collRACPRelevantDiagnosisList); else pastMedicalHistoryVo.setRelevantDiagnosis(null); }