private String[] getUIValidationErrors(RoleDisciplineSecurityLevelVoCollection voCollRoleSecurityLevel) { List<String> errors = new ArrayList<String>(); if(form.cmbRoleDetail().getValue() == null) errors.add("'Role' is mandatory"); if(voCollRoleSecurityLevel == null || voCollRoleSecurityLevel.size() == 0) errors.add("Nothing selected to save"); for(RoleDisciplineSecurityLevelVo voRoleDisSec : voCollRoleSecurityLevel) { if(voRoleDisSec.getOrderingSecurityLevel() == null && voRoleDisSec.getViewingSecurityLevel() == null) errors.add("No 'Ordering Security Level' or 'Viewing Security Level' selected"); } return errors.size() > 0 ? errors.toArray(new String[0]) : null; }
private void populateScreenFromData(RoleDisciplineSecurityLevelVoCollection voCollRoleDispSecurity) { if(voCollRoleDispSecurity == null) throw new CodingRuntimeException("voCollRoleDispSecurity is null in method populateScreenFromData"); form.cmbRoleDetail().newRow(form.cmbRole().getValue(), form.cmbRole().getValue().getName()); form.cmbRoleDetail().setValue(form.cmbRole().getValue()); for(RoleDisciplineSecurityLevelVo voRoleDispSec : voCollRoleDispSecurity) { ServiceRefVo voService = voRoleDispSec.getService(); for(int i=0;i<form.grdDiscipline().getRows().size(); i++) { grdDisciplineRow row = form.grdDiscipline().getRows().get(i); if(row.getRows() != null && row.getRows().size() > 0) { for(int p=0;p<row.getRows().size();p++) { grdDisciplineRow cRow = row.getRows().get(p); if(cRow.getColServiceValue().equals(voService)) { cRow.getColOrderingSecurityLevel().setValue(voRoleDispSec.getOrderingSecurityLevel()); cRow.getColViewingSecurityLevel().setValue(voRoleDispSec.getViewingSecurityLevel()); cRow.setValue(voRoleDispSec); } } } } } if(voCollRoleDispSecurity.size() > 0) form.getLocalContext().setRecordsExist(true); }