dw1434

Geocoder: Triggering the display of candidate addresses

Discussion created by dw1434 on Jun 9, 2014
Latest reply on Jun 11, 2014 by dw1434
From elsewhere in my application,  I want to be able put an address in the Geocoder and trigger the display of candidate addresses so that the user can pick one.

This code accomplishes the first goal -- getting a string  into the Geocoder:
simplemap.geocoder.focus();
$geocoderInput = $dom.find("#simplemap_divGeocoder_input");
$geocoderInput.val("100 W Peachtree, Atlanta, GA");

But I have not been able to find a way to trigger the display of candidate addresses so that the user can pick one.
This statement doesn't work:
$geocoderInput.trigger("keyup");

Neither did the other triggers ("keydown", "keypress") or combinations thereof.

From looking at the Geocoder code on GitHub*, it seems like the "keyup" trigger, once we have more than a couple of characters of text in the input box, should work.  But it doesn't.

The Geocoder only seems to respond to actual key presses on the keyboard. How does it know the difference between an actual keypress and the event which says this happened?

Thanks in advance for any help or insights.

*https://github.com/Esri/arcgis-dijit-geocoder-js

Outcomes