private boolean save() { EmergencyAttendanceForTrackingVo emergAttendanceToSave=populateDataFromScreen(form.getLocalContext().getEmergencyAttendance()); String[] errors = emergAttendanceToSave.validate(); if (errors != null && errors.length > 0) { engine.showErrors(errors); return false; } try { form.getLocalContext().setEmergencyAttendance(domain.save(emergAttendanceToSave)); } catch (StaleObjectException e) { engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); engine.close(DialogResult.ABORT); return false; } return true; }
private void populateScreenFromData(EmergencyAttendanceForTrackingVo emergencyAttendance) { if (emergencyAttendance==null) return; form.txtComments().setValue(emergencyAttendance.getComments()); }