diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ReplaceWidget.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ReplaceWidget.java index 1968a23..057d965 100644 --- a/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ReplaceWidget.java +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ReplaceWidget.java @@ -416,19 +416,19 @@ public class ReplaceWidget extends SimpleContainer { comboReplaceElementsLeaf.clear(); comboReplaceElementsLeaf.reset(); comboReplaceElementsLeaf.getStore().clear(); + comboReplaceElementsLeaf.getStore().addAll( + factory.replaceElements); comboReplaceElementsLeaf.getStore() - .addAll(factory.replaceElements); - comboReplaceElementsLeaf.getStore().commitChanges(); + .commitChanges(); comboReplaceElementsLeaf.setVisible(true); comboReplaceElementsLeaf.redraw(); + comboColumns.clear(); + comboColumns.setVisible(false); + firstArg.setVisible(false); + firstArg.setEmptyText(""); + secondArg.setVisible(false); + secondArg.setEmptyText(""); if (!existOperation(source)) { - - comboColumns.clear(); - comboColumns.setVisible(false); - firstArg.setVisible(false); - firstArg.setEmptyText(""); - secondArg.setVisible(false); - secondArg.setEmptyText(""); addOperation(); } break; @@ -440,21 +440,23 @@ public class ReplaceWidget extends SimpleContainer { comboReplaceElementsLeaf.clear(); comboReplaceElementsLeaf.reset(); comboReplaceElementsLeaf.getStore().clear(); + comboReplaceElementsLeaf.getStore().addAll( + factory.replaceElementsArithmetic); comboReplaceElementsLeaf.getStore() - .addAll(factory.replaceElementsArithmetic); - comboReplaceElementsLeaf.getStore().commitChanges(); + .commitChanges(); comboReplaceElementsLeaf.setVisible(true); comboReplaceElementsLeaf.redraw(); + + comboColumns.clear(); + comboColumns.setVisible(false); + firstArg.setVisible(false); + firstArg.setEmptyText(""); + secondArg.setVisible(false); + secondArg.setEmptyText(""); if (!existOperation(source)) { - comboColumns.clear(); - comboColumns.setVisible(false); - firstArg.setVisible(false); - firstArg.setEmptyText(""); - secondArg.setVisible(false); - secondArg.setEmptyText(""); addOperation(); } - break; + break; case SubstringByRegex: comboReplaceElementsLeaf.setVisible(false); comboColumns.clear(); @@ -715,18 +717,20 @@ public class ReplaceWidget extends SimpleContainer { comboReplaceElementsLeaf.clear(); comboReplaceElementsLeaf.reset(); comboReplaceElementsLeaf.getStore().clear(); + comboReplaceElementsLeaf.getStore().addAll( + factory.replaceElements); comboReplaceElementsLeaf.getStore() - .addAll(factory.replaceElements); - comboReplaceElementsLeaf.getStore().commitChanges(); + .commitChanges(); comboReplaceElementsLeaf.setVisible(true); comboReplaceElementsLeaf.redraw(); + + comboColumns.clear(); + comboColumns.setVisible(false); + firstArg.setVisible(false); + firstArg.setEmptyText(""); + secondArg.setVisible(false); + secondArg.setEmptyText(""); if (!existOperation(source)) { - comboColumns.clear(); - comboColumns.setVisible(false); - firstArg.setVisible(false); - firstArg.setEmptyText(""); - secondArg.setVisible(false); - secondArg.setEmptyText(""); addOperation(); } break; @@ -738,18 +742,20 @@ public class ReplaceWidget extends SimpleContainer { comboReplaceElementsLeaf.clear(); comboReplaceElementsLeaf.reset(); comboReplaceElementsLeaf.getStore().clear(); + comboReplaceElementsLeaf.getStore().addAll( + factory.replaceElementsArithmetic); comboReplaceElementsLeaf.getStore() - .addAll(factory.replaceElementsArithmetic); - comboReplaceElementsLeaf.getStore().commitChanges(); + .commitChanges(); comboReplaceElementsLeaf.setVisible(true); comboReplaceElementsLeaf.redraw(); + + comboColumns.clear(); + comboColumns.setVisible(false); + firstArg.setVisible(false); + firstArg.setEmptyText(""); + secondArg.setVisible(false); + secondArg.setEmptyText(""); if (!existOperation(source)) { - comboColumns.clear(); - comboColumns.setVisible(false); - firstArg.setVisible(false); - firstArg.setEmptyText(""); - secondArg.setVisible(false); - secondArg.setEmptyText(""); addOperation(); } break; @@ -1046,13 +1052,12 @@ public class ReplaceWidget extends SimpleContainer { if (comboLeaf.getCurrentValue() == null) { throw new ReplaceTypeMapException("Fill all field!"); } else { - + comboLeafReplaceType = comboLeaf.getCurrentValue() .getReplaceType(); - cType = ColumnDataType - .getColumnDataTypeFromId(column - .getDataTypeName()); - + cType = ColumnDataType.getColumnDataTypeFromId(column + .getDataTypeName()); + switch (replaceColumnByExpressionType) { case Replace: expLeaf = mapReplace.map( @@ -1092,8 +1097,7 @@ public class ReplaceWidget extends SimpleContainer { index++; if (index < vert.getWidgetCount()) { - expContainerOperation = calcCExpression(index, - cType); + expContainerOperation = calcCExpression(index, cType); if (expContainerOperation == null) { return null; } else {