Does the 4.x search widget require a view?

1127
5
Jump to solution
08-29-2017 09:32 AM
MarcBate
Occasional Contributor II

I'd like to be able to use the search widget without a map. It seems to work, except the 'select-result' event never fires. Any ideas?

0 Kudos
1 Solution

Accepted Solutions
KellyHutchins
Esri Frequent Contributor

This is a bug in version 4.4 that will be addressed in version 4.5 of the API. 

View solution in original post

5 Replies
KellyHutchins
Esri Frequent Contributor

This is a bug in version 4.4 that will be addressed in version 4.5 of the API. 

MarcBate
Occasional Contributor II

Is there also a bug where the search widget (which is associated with a view this time) but it is ignoring these properties when I set them to false? 

var searchWidget = new Search({
  container: "searchWidget",
  view: view,
  resultGraphicEnabled: false,
  popupOpenOnSelect: false,
  popupEnabled: false
});

It is always showing the resulting graphic and a popup. As a workaround, I'm calling view.popup.close() and view.graphics.removeAll() in the 'select-result' event

KellyHutchins
Esri Frequent Contributor

Yes that also looks like an issue that is fixed for the next release (version 4.5)

RobertScheitlin__GISP
MVP Emeritus

Marc,

   So you are attempting to use the search widget in your code and you do not have a view at all? When I added it to a sample that did have a view but the search widgets view was set to null I did not have any issue.

0 Kudos
MarcBate
Occasional Contributor II

I want to essentially just geocode an address and get the XY coordinates for whatever the user selected. The widget displays without a view, but the 'select-result' event never fires. As a workaround, I'm just creating a basic view and hiding the DOM element

0 Kudos