diff --git a/src/main/java/org/gcube/portlets/user/td/columnwidget/client/batch/ReplaceBatchDialog.java b/src/main/java/org/gcube/portlets/user/td/columnwidget/client/batch/ReplaceBatchDialog.java index 506e773..1ed7493 100644 --- a/src/main/java/org/gcube/portlets/user/td/columnwidget/client/batch/ReplaceBatchDialog.java +++ b/src/main/java/org/gcube/portlets/user/td/columnwidget/client/batch/ReplaceBatchDialog.java @@ -83,6 +83,7 @@ public class ReplaceBatchDialog extends Window { + caught.getLocalizedMessage()); UtilsGXT3.alert("Error on batch replace", "Error on batch replace"); + close(); } diff --git a/src/main/java/org/gcube/portlets/user/td/columnwidget/client/batch/ReplaceBatchPanel.java b/src/main/java/org/gcube/portlets/user/td/columnwidget/client/batch/ReplaceBatchPanel.java index 92a1742..5e1c7ab 100644 --- a/src/main/java/org/gcube/portlets/user/td/columnwidget/client/batch/ReplaceBatchPanel.java +++ b/src/main/java/org/gcube/portlets/user/td/columnwidget/client/batch/ReplaceBatchPanel.java @@ -85,7 +85,7 @@ public class ReplaceBatchPanel extends FramedPanel implements protected static final String DON_T_REPLACE = "Don't replace"; - private TextButton btnApply; + private TextButton btnSave; private TextButton btnClose; protected ListLoader> loader; @@ -250,14 +250,15 @@ public class ReplaceBatchPanel extends FramedPanel implements toolBar.addStyleName(ThemeStyles.getStyle().borderTop()); toolBar.getElement().getStyle().setProperty("borderBottom", "none"); - btnApply = new TextButton("Save"); - btnApply.setIcon(ResourceBundle.INSTANCE.save()); - btnApply.setIconAlign(IconAlign.RIGHT); - btnApply.setTitle("Apply Filter"); - btnApply.addSelectHandler(new SelectHandler() { + btnSave = new TextButton("Save"); + btnSave.setIcon(ResourceBundle.INSTANCE.save()); + btnSave.setIconAlign(IconAlign.RIGHT); + btnSave.setTitle("Save"); + btnSave.addSelectHandler(new SelectHandler() { public void onSelect(SelectEvent event) { - Log.debug("Pressed Apply"); + Log.debug("Pressed Save"); + btnSave.disable(); save(); } @@ -279,7 +280,7 @@ public class ReplaceBatchPanel extends FramedPanel implements flowButton.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE); flowButton.setPack(BoxLayoutPack.CENTER); - flowButton.add(btnApply, new BoxLayoutData(new Margins(2, 4, 2, 4))); + flowButton.add(btnSave, new BoxLayoutData(new Margins(2, 4, 2, 4))); flowButton.add(btnClose, new BoxLayoutData(new Margins(2, 4, 2, 4))); VerticalLayoutContainer v = new VerticalLayoutContainer(); @@ -449,6 +450,7 @@ public class ReplaceBatchPanel extends FramedPanel implements if (effectiveReplaceList.size() == 0) { UtilsGXT3 .alert("Attention", "Select at least one value to replace"); + btnSave.enable(); } else { startReplaceBatch(effectiveReplaceList); }