private SessionTheatreDelayAndDebriefTimesVo populateDataFromScreen( SessionTheatreDelayAndDebriefTimesVo session) { if (session == null) session = new SessionTheatreDelayAndDebriefTimesVo(); session.setSafetyBriefDelayReason(form.cmbDelayReason().getValue()); session.setSafetyBriefDelayReasonDetails(form.txtDetails().getValue()); return session; }
private void populateScreenFromData() { clearScreen(); SessionTheatreDelayAndDebriefTimesVo session = form.getLocalContext().getSessionDelay(); if (session == null) return; if (session.getSafetyBriefDelayMinsIsNotNull()) form.lblDelayMins().setValue(session.getSafetyBriefDelayMins().toString()); form.cmbDelayReason().setValue(session.getSafetyBriefDelayReason()); form.txtDetails().setValue(session.getSafetyBriefDelayReasonDetails()); }
@Override protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException { // WDEV-22586 SessionTheatreDelayAndDebriefTimesVo session = domain.getSessionDelay(form.getGlobalContext().Scheduling.getTheatreSession()); int mins = 0; if (args != null && args.length == 1) { if (args[0] instanceof Integer) { mins = (Integer) args[0]; session.setSafetyBriefDelayMins(mins); form.btnCancel().setVisible(false); } else { form.btnCancel().setVisible(true); } } else throw new CodingRuntimeException("Mandatory args missing"); form.getLocalContext().setSessionDelay(session); populateScreenFromData(); }
@Override protected void onBtnSaveClick() throws ims.framework.exceptions.PresentationLogicException { SessionTheatreDelayAndDebriefTimesVo session = form.getLocalContext().getSessionDelay(); session = populateDataFromScreen(session); String[] arrErrors = session.validate(validateUI()); if (arrErrors != null) { engine.showErrors(arrErrors); return; } try { domain.saveSessionDelay(session); } catch (StaleObjectException e) { engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); form.getLocalContext() .setSessionDelay( domain.getSessionDelay(form.getGlobalContext().Scheduling.getTheatreSession())); populateScreenFromData(); return; } engine.close(DialogResult.OK); }