AnsweredAssumed Answered

Filter Widget Errors

Question asked by jamesfreddyc on Jan 17, 2018

The filter widget fails/errors when a layer in the web map source to the WAB has been removed and re-added to the same web map (in the same position in the TOC).  Simply remove and re-add the web layer and the widget breaks in the deployed WAB.

 

Anyone else notice this?

Fixes?

 

This happens in the applyFilterValues function on line 294 of the Widget.js file

      applyFilterValues: function(node, filterObj, evt) {
        var expr = node.filterParams && (node.expr || node.filterParams.getFilterExpr());
        if (expr) {
          node.expr = expr;
          // getFilterExpr
          var layerId = filterObj.layerId;
          var idx = html.getAttr(node, 'data-index');
          var layerInfo = this.layerInfosObj.getLayerInfoById(layerId);
          if (layerInfo.isShowInMap() && layerInfo.isInScale()) {
            this._bindMapUpdateEvents(node, true);
          } else {
            html.addClass(node, 'applied');
          }
          this._setItemFilter(layerId, idx, node.expr, filterObj.enableMapFilter);
          var layerFilterExpr = this._getExpr(layerId);
          var enableMapFilter = this._getMapFilterControl(layerId);
          this.filterManager.applyWidgetFilter(layerId, this.id, layerFilterExpr, enableMapFilter);
        }

Outcomes