public boolean save() throws PresentationLogicException { if (form.intNoColumns().getValue() != null && form.intNoColumns().getValue() > MAX_NO_BUTTONS) { engine.showMessage("The maximum number of Columns is " + MAX_NO_BUTTONS); return false; } AppTopButtonConfigVo configuration = populateDataFromScreen(); String[] errors = configuration.validate(); if(errors != null && errors.length > 0) { engine.showErrors(errors); return false; } try { configuration = domain.saveConfiguration(configuration); form.getLocalContext().setRecord(configuration); } catch (StaleObjectException e) { engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); return false; } return true; }
private void addConfiguration(AppTopButtonConfigVo value) { if(value != null) { GenForm.grdListRow row = form.grdList().getRows().newRow(); row.setcolName(value.getName()); row.setValue(value); } }
public AppTopButtonConfigVo getTopButtonConfiguration(AppTopButtonConfigRefVo config) { if (config == null) return null; return AppTopButtonConfigVoAssembler.create((AppTopButtonConfig)getDomainFactory().getDomainObject(config)); }
public AppTopButtonConfigVo saveConfiguration(AppTopButtonConfigVo configuration) throws StaleObjectException { if(configuration == null) throw new DomainRuntimeException("Invalid Top Button Configuration"); if(!configuration.isValidated()) throw new DomainRuntimeException("Top Button Configuration Not Validated"); DomainFactory factory = this.getDomainFactory(); AppTopButtonConfig domainObject = AppTopButtonConfigVoAssembler.extractAppTopButtonConfig(factory, configuration); factory.save(domainObject); return AppTopButtonConfigVoAssembler.create(domainObject); }
public void populateInstanceControls() { clearInstanceControls(); AppTopButtonConfigVo configuration = form.grdList().getValue(); form.getLocalContext().setRecord(configuration); if(configuration != null) { form.txtName().setValue(configuration.getName()); form.intNoColumns().setValue(configuration.getNoColumns()); form.chkIncludePatientSelectionHistory().setValue(configuration.getIncludePatientHistory()); addDefaultItemNodes(); AppTopButtonVoCollection buttons = configuration.getButtons(); if(buttons != null) { for(int x = 0; x < buttons.size(); x++) { AppTopButtonVo button = buttons.get(x); if(button != null) { addButton(getButtonsNode(), button, false); } } } AppTopButtonSectionVoCollection sections = configuration.getSections(); if(sections != null) { for(int x = 0; x < sections.size(); x++) { AppTopButtonSectionVo section = sections.get(x); if(section != null) { addSection(getSectionsNode(), section, false); } } } } form.treItems().expandAll(); updateControlsState(); }