From 134c530b72ee2b0e817c7f4ca4401f630d696066 Mon Sep 17 00:00:00 2001 From: Yuriy Artamonov Date: Thu, 28 Mar 2013 13:59:32 +0000 Subject: [PATCH] Merge from trunk 10667 --- .../cuba/gui/components/actions/ExcludeAction.java | 10 +++------- .../cuba/gui/components/actions/RemoveAction.java | 10 +++------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/modules/gui/src/com/haulmont/cuba/gui/components/actions/ExcludeAction.java b/modules/gui/src/com/haulmont/cuba/gui/components/actions/ExcludeAction.java index 264380dfd4..38ae58a306 100644 --- a/modules/gui/src/com/haulmont/cuba/gui/components/actions/ExcludeAction.java +++ b/modules/gui/src/com/haulmont/cuba/gui/components/actions/ExcludeAction.java @@ -1,12 +1,7 @@ /* - * Copyright (c) 2011 Haulmont Technology Ltd. All Rights Reserved. + * Copyright (c) 2013 Haulmont Technology Ltd. All Rights Reserved. * Haulmont Technology proprietary and confidential. * Use is subject to license terms. - - * Author: Konstantin Krivopustov - * Created: 21.03.11 19:05 - * - * $Id$ */ package com.haulmont.cuba.gui.components.actions; @@ -15,6 +10,7 @@ import com.haulmont.cuba.core.entity.Entity; import com.haulmont.cuba.gui.components.Component; import com.haulmont.cuba.gui.components.ListComponent; import com.haulmont.cuba.gui.data.CollectionDatasource; +import com.haulmont.cuba.gui.data.Datasource; import com.haulmont.cuba.gui.data.PropertyDatasource; import com.haulmont.cuba.security.entity.EntityAttrAccess; @@ -102,7 +98,7 @@ public class ExcludeAction extends RemoveAction { ds.excludeItem((Entity) item); } - if (this.autocommit) { + if (autocommit && (ds.getCommitMode() != Datasource.CommitMode.PARENT)) { try { ds.commit(); } catch (RuntimeException e) { diff --git a/modules/gui/src/com/haulmont/cuba/gui/components/actions/RemoveAction.java b/modules/gui/src/com/haulmont/cuba/gui/components/actions/RemoveAction.java index 695b9656b4..d6709f08f9 100644 --- a/modules/gui/src/com/haulmont/cuba/gui/components/actions/RemoveAction.java +++ b/modules/gui/src/com/haulmont/cuba/gui/components/actions/RemoveAction.java @@ -1,12 +1,7 @@ /* - * Copyright (c) 2011 Haulmont Technology Ltd. All Rights Reserved. + * Copyright (c) 2013 Haulmont Technology Ltd. All Rights Reserved. * Haulmont Technology proprietary and confidential. * Use is subject to license terms. - - * Author: Konstantin Krivopustov - * Created: 21.03.11 18:55 - * - * $Id$ */ package com.haulmont.cuba.gui.components.actions; @@ -15,6 +10,7 @@ import com.haulmont.cuba.core.entity.Entity; import com.haulmont.cuba.gui.AppConfig; import com.haulmont.cuba.gui.components.*; import com.haulmont.cuba.gui.data.CollectionDatasource; +import com.haulmont.cuba.gui.data.Datasource; import com.haulmont.cuba.gui.data.PropertyDatasource; import com.haulmont.cuba.security.entity.EntityAttrAccess; import com.haulmont.cuba.security.entity.EntityOp; @@ -184,7 +180,7 @@ public class RemoveAction extends ItemTrackingAction { datasource.removeItem((Entity) item); } - if (this.autocommit) { + if (autocommit && (datasource.getCommitMode() != Datasource.CommitMode.PARENT)) { try { datasource.commit(); } catch (RuntimeException e) {