Events

Listen for Events

DOTSGlobalAddressComplete.listen(<Event>, <Function (){}>);

Listen for Events Example

DOTSGlobalAddressComplete.listen("populate", function(address, variations) {
    document.getElementById("LabelJSON").innerText = address.FormattedAddress.toUpperCase();
});

Events Table

EventDescription
loadThe control is ready and is now listening to page events.
showThe control is now on the page.
hideThe control has been hidden.
searchThe user is searching. You can modify the searchTerm and lastId of the search object (parameter 1) at this stage.
resultsResults have been returned from the find service. You can modify the list of suggestions returned (parameter 1) and access the extended attributes object (parameter 2) including properties such as ContainerCount.
noresultsNo matching results were returned from the find service.
displayThe suggestions have been shown to the user.
selectThe user has selected a suggestion. The chosen suggestion can be accessed (parameter 1).
prepopulateThe full address has been returned from the retrieve service. The address object (parameter 1) can be accessed and modified before fields are populated, as well as full list of language variations (parameter 2) for the address.
populateThe address fields have been populated. This is the most common event to listen for, and will allow you to populate your own fields with your own logic using the address object (parameter 1) and the list of address variations (parameter 2).
countryThe country has been changed. The selected country object (parameter 1) with iso2, iso3 and name properties is passed through.
manualWhen the manualEntry option is passed through and the user selects the option to enter their address manually this event will fire.
errorAn error has occured. The error message (parameter 1) is passed through. Typically errors are not shown to the user, but can be handled manually here if needed.

Manual Loading

DOTSGlobalAddressComplete.load();