Problem with Search Widget

4446
3
Jump to solution
05-07-2015 04:44 AM
VeronikaBraatz
New Contributor III

Hello,

I am currently constructing a map with JS API. Unfortunately the Search Widget is causing a Problem. As long as I Search esriFieldTypeString Fields it works fine. As soon as I change to a different fieldtype my console returns:

Error: Unable to complete  operation.

Stack-Trace:

x/h.load@http://js.arcgis.com/3.13/:897:343

.cache["dojo/_base/xhr"]/</b._ioSetArgs/<@http://js.arcgis.com/3.13/:191:67

c@http://js.arcgis.com/3.13/:76:221

d@http://js.arcgis.com/3.13/:76:10

.cache["dojo/_base/Deferred"]/</b.Deferred/this.callback@http://js.arcgis.com/3.13/:77:350

c@http://js.arcgis.com/3.13/:76:401

d@http://js.arcgis.com/3.13/:76:10

.cache["dojo/_base/Deferred"]/</b.Deferred/this.callback@http://js.arcgis.com/3.13/:77:350

.cache["dojo/_base/xhr"]/</b.xhr/<@http://js.arcgis.com/3.13/:195:298

.cache["dojo/Deferred"]/</k@http://js.arcgis.com/3.13/:199:431

.cache["dojo/Deferred"]/</m@http://js.arcgis.com/3.13/:199:357

.cache["dojo/Deferred"]/</f/this.resolve@http://js.arcgis.com/3.13/:201:441

.cache["dojo/Deferred"]/</a@http://js.arcgis.com/3.13/:200:309

.cache["dojo/Deferred"]/</k@http://js.arcgis.com/3.13/:200:70

.cache["dojo/Deferred"]/</m@http://js.arcgis.com/3.13/:199:357

.cache["dojo/Deferred"]/</f/this.resolve@http://js.arcgis.com/3.13/:201:441

.cache["dojo/Deferred"]/</a@http://js.arcgis.com/3.13/:200:309

.cache["dojo/Deferred"]/</k@http://js.arcgis.com/3.13/:200:103

.cache["dojo/Deferred"]/</m@http://js.arcgis.com/3.13/:199:357

.cache["dojo/Deferred"]/</f/this.resolve@http://js.arcgis.com/3.13/:201:441

.cache["dojo/Deferred"]/</a@http://js.arcgis.com/3.13/:200:309

.cache["dojo/Deferred"]/</k@http://js.arcgis.com/3.13/:200:70

.cache["dojo/Deferred"]/</m@http://js.arcgis.com/3.13/:199:357

.cache["dojo/Deferred"]/</f/this.resolve@http://js.arcgis.com/3.13/:201:441

q@http://js.arcgis.com/3.13/:160:170

f@http://js.arcgis.com/3.13/:164:199

and

[object Error]{code: 400, description: "", details: Array[1], httpCode: 400, log: undefined, message: "Unable to c...", name: "Error", number: 0}

This Problem only occurs with our Layers, the Search multiple sources | ArcGIS API for JavaScript Sample works fine.

Unfortunately I can't give you access to our Layers, because they contain internal data.

Any help is appreciated

1 Solution

Accepted Solutions
KellyHutchins
Esri Frequent Contributor

The search fields have to be of type string for feature layer searches. The widget also supports geometry, suggest candidate objects and an array of latitude, longitude. See the search method in the API ref for more details. 

Search | API Reference | ArcGIS API for JavaScript

View solution in original post

3 Replies
RobertScheitlin__GISP
MVP Emeritus

Veronika,

   Could it be related to this issue?

dijit/search widget - not working

0 Kudos
KellyHutchins
Esri Frequent Contributor

The search fields have to be of type string for feature layer searches. The widget also supports geometry, suggest candidate objects and an array of latitude, longitude. See the search method in the API ref for more details. 

Search | API Reference | ArcGIS API for JavaScript

VeronikaBraatz
New Contributor III

Hi Kelly,

thanks a lot for your help. Do you or anyone else know of a widget/method to search for type double fields?

My workaround would be to add a colum to my feature layer containing the data I want to search but defined as string.

Does anyone have a more elegant solution?

Thanks