diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ConditionWidget.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ConditionWidget.java index e804384..4fb8dd3 100644 --- a/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ConditionWidget.java +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ConditionWidget.java @@ -410,7 +410,7 @@ public class ConditionWidget extends SimpleContainer { comboOp.setTriggerAction(TriggerAction.ALL); horiz.add(comboOp, new BoxLayoutData(new Margins(0))); - if (column==null|| column.getDataTypeName().compareTo("Date") != 0) { + if (column==null|| column.getDataTypeName()==null|| column.getDataTypeName().compareTo("Date") != 0) { horiz.add(firstArg, new BoxLayoutData(new Margins(0))); horiz.add(andText, new BoxLayoutData(new Margins(0))); horiz.add(secondArg, new BoxLayoutData(new Margins(0))); diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ReplaceColumnByExpressionDialog.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ReplaceColumnByExpressionDialog.java index 1f34fa6..e2c5679 100644 --- a/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ReplaceColumnByExpressionDialog.java +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ReplaceColumnByExpressionDialog.java @@ -214,9 +214,11 @@ public class ReplaceColumnByExpressionDialog extends Window implements ColumnTypeCode.TIMEDIMENSION.toString()) == 0) { removableColumn.add(c); } else { - if (c.getColumnId() != null + if (c.getColumnId() != null && column != null + && column.getColumnId() != null + && !column.getColumnId().isEmpty() && c.getColumnId().compareTo(column.getColumnId()) == 0) { - column=c; + column = c; } } } diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ReplaceColumnByExpressionPanel.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ReplaceColumnByExpressionPanel.java index 9ec337c..7a9012c 100644 --- a/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ReplaceColumnByExpressionPanel.java +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ReplaceColumnByExpressionPanel.java @@ -136,7 +136,7 @@ public class ReplaceColumnByExpressionPanel extends FramedPanel { } protected void calcHeight() { - if (column != null + if (column != null && column.getDataTypeName()!=null && !column.getDataTypeName().isEmpty() && (column.getDataTypeName().compareTo( ColumnDataType.Text.toString()) == 0 || column.getDataTypeName().compareTo( @@ -307,7 +307,7 @@ public class ReplaceColumnByExpressionPanel extends FramedPanel { VerticalLayoutContainer replaceValueFieldSetLayout = new VerticalLayoutContainer(); replaceValueFieldSet.add(replaceValueFieldSetLayout); - if (column == null) { + if (column == null || column.getDataTypeName()==null ||column.getDataTypeName().isEmpty()) { replaceValue = new TextField(); replaceValue.setToolTip("Replace Value"); replaceValue.setValue(""); @@ -361,17 +361,18 @@ public class ReplaceColumnByExpressionPanel extends FramedPanel { } protected void setSelectedColumn() { - if (column == null) { + if (column == null|| column.getTypeCode()==null) { } else { + ColumnTypeCode typeCode = ColumnTypeCode .getColumnTypeCodeFromId(column.getTypeCode()); HTML errorMessage; if (typeCode == null) { errorMessage = new HTML( - "This column has column data type null!"); + "This column has column type code null!"); UtilsGXT3.alert("Error", - "This column has column data type null!!"); + "This column has column type code null!!"); return; }