@Override protected void onBtnSaveClick() throws ims.framework.exceptions.PresentationLogicException { StringBuffer errors = new StringBuffer(); if (form.dtimDisch().getValue() == null) { errors.append("Discharge Date Time is mandatory. \n"); } if (form.cmbDestination().getValue() == null) { errors.append("Discharge Destination is mandatory. \n"); } if (form.cmbMethod().getValue() == null) { errors.append("Method of Discharge is mandatory. \n"); } if (errors != null && errors.length() > 0) { engine.showMessage(errors.toString()); return; } RCHTInpatientDischargeVo inpatientDischarge = new RCHTInpatientDischargeVo(); inpatientDischarge.setDischargeDateTime(form.dtimDisch().getValue()); inpatientDischarge.setDischargeDestination(form.cmbDestination().getValue()); inpatientDischarge.setMethodOfDischarge(form.cmbMethod().getValue()); form.getGlobalContext().Core.setRCHTInpatientDischarge(inpatientDischarge); engine.close(DialogResult.OK); }