AnsweredAssumed Answered

An error occurred when starting a widget embedded within InfoWindow: Cannot read property '1' of null

Question asked by tr3v on Nov 4, 2015
Latest reply on Nov 4, 2015 by tr3v

I am getting the above error (init.js:919 API v3.14) identifying a feature in a javascript map viewer, when calling `infoWindow.setFeatures(featureSet);`. The problem is caused by a map service having field aliases with trailing colons in them. The following is part of the json returned from the map service query (geometry removed).

 

I can see the problem, but not sure how to go about fixing it? Is it caused by the json deserialization, serialization by the REST API (10.3.1 server), or a bug in the javascript API?

 

If I only choose outfields that have no trailing colon, it works. I have no control over the offending map service.

 

  {
"results":[{
  "layerId":37,
  "layerName":"Waste Water Lateral",
  "displayFieldName":"Unit ID:",
  "value":"NP-MANGO0131SL/1",
  "attributes":{
  "OBJECTID":"2474425",
  "Depth":"0.6",
  "SHAPE":"Polyline",
  "Install":"Null",
  "Unit ID:":"NP-MANGO0131SL/1",
  "Owner:":"W&W",
  "Asset ID:":"115807",
  "Comments:":"Null",
  "NPDC_VECTOR_SDEADMIN_SVEW_WWLATERAL_area":"NP",
  "SHAPE_Length":"8.117518"
  },
  "geometryType":"esriGeometryPolyline"

// geometry removed
  }
}]

Outcomes