private void populateHospitalConfigGrid(HospitalAtNightCutOffPointsConfigVoCollection configCollection) throws PresentationLogicException { form.grdHospAtNight().getRows().clear(); if (configCollection == null) return; for (int i = 0; i < configCollection.size(); i++) { HospitalAtNightCutOffPointsConfigVo hospitalConfig = configCollection.get(i); grdHospAtNightRow row = form.grdHospAtNight().getRows().newRow(); row.setHospName(hospitalConfig.getHospital().getName()); row.setEndTime(hospitalConfig.getEndTime().toString()); row.setStartTime(hospitalConfig.getStartTime().toString()); row.setValue(hospitalConfig); } if (form.getLocalContext().getSelectedHospital() != null) { try { form.getLocalContext().setSelectedHospital(domain.getHospitalConfig(form.getLocalContext().getSelectedHospital())); } catch (StaleObjectException e) { engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); form.getLocalContext().setSelectedHospital(null); open(); return ; } form.grdHospAtNight().setValue(form.getLocalContext().getSelectedHospital()); } }
private void populateScreenFromData() throws PresentationLogicException { HospitalAtNightCutOffPointsConfigVoCollection configCollection = domain.listHospitalsConfig(); populateHospitalConfigGrid(configCollection); populateInstanceControlsFromData(form.getLocalContext().getSelectedHospital()); }