diff --git a/src/main/java/com/metaweb/gridworks/gel/ControlFunctionRegistry.java b/src/main/java/com/metaweb/gridworks/gel/ControlFunctionRegistry.java index 1efbc00c6..829e0982c 100644 --- a/src/main/java/com/metaweb/gridworks/gel/ControlFunctionRegistry.java +++ b/src/main/java/com/metaweb/gridworks/gel/ControlFunctionRegistry.java @@ -57,6 +57,7 @@ import com.metaweb.gridworks.gel.controls.ForEach; import com.metaweb.gridworks.gel.controls.ForNonBlank; import com.metaweb.gridworks.gel.controls.If; import com.metaweb.gridworks.gel.controls.IsBlank; +import com.metaweb.gridworks.gel.controls.IsError; import com.metaweb.gridworks.gel.controls.IsNonBlank; import com.metaweb.gridworks.gel.controls.IsNotNull; import com.metaweb.gridworks.gel.controls.IsNull; @@ -169,5 +170,6 @@ public class ControlFunctionRegistry { registerControl("isBlank", new IsBlank()); registerControl("isNonBlank", new IsNonBlank()); registerControl("isNumeric", new IsNumeric()); + registerControl("isError", new IsError()); } } diff --git a/src/main/java/com/metaweb/gridworks/gel/controls/IsError.java b/src/main/java/com/metaweb/gridworks/gel/controls/IsError.java new file mode 100644 index 000000000..52ba9923f --- /dev/null +++ b/src/main/java/com/metaweb/gridworks/gel/controls/IsError.java @@ -0,0 +1,15 @@ +package com.metaweb.gridworks.gel.controls; + +import com.metaweb.gridworks.expr.ExpressionUtils; + +public class IsError extends IsTest { + @Override + protected String getDescription() { + return "Returns whether o is an error"; + } + + @Override + protected boolean test(Object o) { + return ExpressionUtils.isError(o); + } +} diff --git a/src/main/webapp/scripts/views/data-table-column-header-ui.js b/src/main/webapp/scripts/views/data-table-column-header-ui.js index ca1888728..a62519c47 100644 --- a/src/main/webapp/scripts/views/data-table-column-header-ui.js +++ b/src/main/webapp/scripts/views/data-table-column-header-ui.js @@ -170,6 +170,33 @@ DataTableColumnHeaderUI.prototype._createMenuForColumnHeader = function(elmt) { } ); } + }, + {}, + { + label: "By Error", + click: function() { + ui.browsingEngine.addFacet( + "list", + { + "name" : self._column.headerLabel + ": Error?", + "columnName" : self._column.headerLabel, + "expression" : "isError(value)" + } + ); + } + }, + { + label: "By Blank", + click: function() { + ui.browsingEngine.addFacet( + "list", + { + "name" : self._column.headerLabel + ": Blank?", + "columnName" : self._column.headerLabel, + "expression" : "isBlank(value)" + } + ); + } } ] },