WAB BatchAttr.Editor: featureLayerObject.selectFeatures NOT firing query

03-12-2019 03:13 AM
New Contributor III


I'm experiencing an issue with the widget BatchAttributeEditor of WAB:

It connects to a featureLayer (from an ArcGIS server), and at the end of drawing shape (or point) it should fire the query to the service, in order to select features of a query (c variable).

_selectSearchLayer: function (a) {   // a is the shape of selection
   var c = new U; // U is esri/query Object
   if ("point" === a.type || "polyline" === a.type) {
      var d = ea.getUnitValueForSR(this.map.spatialReference);
      c.geometry = da.buffer(a, 1, d)
   } else c.geometry = a;
   "FeatureQuery" === this.toolType && (c.outFields = [this.config.selectByLayer.queryField]);
   c.spatialRelationship = U.SPATIAL_REL_INTERSECTS;
   this.selectByLayer.layerObject.selectFeatures(c, W.SELECTION_NEW)
      .then(b.hitch(this, this._searchByLayerComplete)) // b.hitch is lang.hitch

When I use the point draw-tool it works,

when I use extent draw-tool instead, it selects features WITHOUT firing query.

It's very strange: I don't find the query in network console of browser, but if I draw an extent around features it selects correctly features, but without querying the service.
Could it be a matter of data-caching?



0 Kudos
2 Replies
MVP Emeritus


   It is likely doing the work clientside for rectangles and polygons. A FeatureLayer will attempt to do work on the client if possible.

New Contributor III

Yes Robert,

it seems to do just that if draw-tool is "extent" (rectangle).

However I have solved in this way. I transformed extent parameter in a polygon and it returns to work in the usual way.

var extentPolygon = esri.geometry.Polygon.fromExtent(a);

Thanks for your help!



0 Kudos