/** * @{inheritedDoc} */ @Override public void editCommit(IEmaginController sourceController, VLViewComponentXML inlineActionconfiguration, IFieldsetContent form) { IPersistenceServiceDelegate.super.editCommit(sourceController, inlineActionconfiguration, form); }
/** * @{inheritedDoc} */ @Override public void editCommit(IEmaginController sourceController, VLViewComponentXML inlineActionConfiguration, List<IInputComponentWrapper> rows) { IPersistenceServiceDelegate.super.editCommit(sourceController, inlineActionConfiguration, rows); String action = inlineActionConfiguration.getPropertyValue(ACTION_NAME); Map<String, Object> vals = extracValue(rows); vals.put(HIDDEN_PREFIX + ACTION_NAME, action); // commit all mofications in same controller IInputComponentWrapper row0 = rows.get(0); Object model = row0.getController().getModel(); String rootModelOid = (String) ReflectionUIUtils.invokeGetterOn(model, DATA_TYPE); int version = (Integer) ReflectionUIUtils.invokeGetterOn(model, DATA_ATTRIBUTES_VERSION); vals.put(HIDDEN_PREFIX + PERSISTENCE_FULL_ID, rootModelOid); vals.put(HIDDEN_PREFIX + PERSISTENCE_VERSION, version); //persistableUpdateOperation.doOperation(JsonObject.fromObject(vals), this::successHandler, getErrorHandler()); persistableUpdateOperation.doOperation(JsonUtils.toJsonObject(vals), this::successHandler, getErrorHandler()); }
delegate.editCommit(controller, configuration, row.getEntries());
delegate.editCommit(controller, inlineActionConfiguration, row.getEntries()); } else { for(IInputComponentWrapper r: row.getEntries()) {
/** * Commit current modifications */ public IActionResult commit() { String persistableDelegate = inlineActionConfiguration.getPropertyValue("persistableDelegate"); if (com.nexitia.emaginplatform.core.commons.utils.StringUtils.isNotBlank(persistableDelegate)) { IPersistenceServiceDelegate delegate = (IPersistenceServiceDelegate) Services.getBean(persistableDelegate); delegate.setSuccessHandler(opResult -> { if (opResult.hasBusinessError()) { onCommitError(opResult); } else { onCommitSuccess(opResult); } }); delegate.setErrorHandler(this::onCommitError); delegate.editCommit(sourceController, inlineActionConfiguration, row.getEntries()); } return ActionResult.success(); }