From 001bf95ec2990a9141b64c9c7801067553ad4279 Mon Sep 17 00:00:00 2001 From: Costantino Perciante Date: Tue, 8 Nov 2016 14:29:33 +0000 Subject: [PATCH] minor fixes git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/widgets/ckan-metadata-publisher-widget@133958 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../ui/TwinColumnSelection/ResourceCellLeft.java | 4 ---- .../TwinColumnSelectionMainPanel.java | 10 +++++----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/client/ui/TwinColumnSelection/ResourceCellLeft.java b/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/client/ui/TwinColumnSelection/ResourceCellLeft.java index 01d030f..a9a8ef9 100644 --- a/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/client/ui/TwinColumnSelection/ResourceCellLeft.java +++ b/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/client/ui/TwinColumnSelection/ResourceCellLeft.java @@ -13,10 +13,6 @@ public class ResourceCellLeft extends AbstractCell{ public void render(com.google.gwt.cell.client.Cell.Context context, ResourceElementBean value, SafeHtmlBuilder sb) { - // Do not render an object if - // - is null; - // - has been moved to the other side; - // - the parent folder is not null; if (value == null || value.isMovedToRight()) { return; } diff --git a/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/client/ui/TwinColumnSelection/TwinColumnSelectionMainPanel.java b/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/client/ui/TwinColumnSelection/TwinColumnSelectionMainPanel.java index 9b4b3bc..7e81515 100644 --- a/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/client/ui/TwinColumnSelection/TwinColumnSelectionMainPanel.java +++ b/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/client/ui/TwinColumnSelection/TwinColumnSelectionMainPanel.java @@ -28,7 +28,6 @@ import com.google.gwt.view.client.SelectionChangeEvent; /** * The twin column panels for selection of the files to attach to the catalague product. * @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it) - * */ public class TwinColumnSelectionMainPanel extends Composite{ @@ -322,15 +321,16 @@ public class TwinColumnSelectionMainPanel extends Composite{ Iterator iterator = setSelected.iterator(); while (iterator.hasNext()) { ResourceElementBean resourceElementBean = (ResourceElementBean) iterator.next(); - resourceElementBean.setMovedToRight(false); + int index = dataProviderLeft.getList().indexOf(resourceElementBean); + if(index != -1){ + resourceElementBean.setMovedToRight(false); + dataProviderLeft.getList().set(index, resourceElementBean); // replace + } } // refresh providers - dataProviderLeft.flush(); dataProviderRight.flush(); - dataProviderLeft.refresh(); dataProviderRight.refresh(); - } }