protected Datasource getDatasourceInternal() { Datasource ds = null; Element element = ((Component.HasXmlDescriptor) getFrame()).getXmlDescriptor(); String datasourceName = element.attributeValue("datasource"); if (!StringUtils.isEmpty(datasourceName)) { DsContext context = getDsContext(); if (context != null) { ds = context.get(datasourceName); } } if (ds == null) { throw new GuiDevelopmentException("Can't find main datasource", getFrame().getId()); } return ds; }
protected void initCommitActions(@SuppressWarnings("unused") InitEvent event) { Component commitAndCloseButton = ComponentsHelper.findComponent(getFrame(), WINDOW_COMMIT_AND_CLOSE); commitAndCloseButtonExists = true; getFrame().addAction( new BaseAction(WINDOW_COMMIT_AND_CLOSE) .withCaption(messages.getMainMessage("actions.OkClose")) getFrame().addAction(commitAction); ); getFrame().addAction(closeAction);
if (dynamicAttributesGuiTools.screenContainsDynamicAttributes(ds.getView(), getFrame().getId())) { ds.setLoadDynamicAttributes(true); UserSessionSource userSessionSource = getBeanLocator().get(UserSessionSource.NAME); getFrame().getWindowManager().showNotification( messages.getMainMessage("entityLocked.msg"), String.format(messages.getMainMessage("entityLocked.desc"), Frame.NotificationType.HUMANIZED ); Action action = getFrame().getAction(WINDOW_COMMIT); if (action != null) action.setEnabled(false); action = getFrame().getAction(WINDOW_COMMIT_AND_CLOSE); if (action != null) action.setEnabled(false);