{"id":5613,"date":"2022-11-14T22:31:35","date_gmt":"2022-11-14T22:31:35","guid":{"rendered":"https:\/\/serviceobjects.wpaladdin.com\/?page_id=5613"},"modified":"2022-12-14T22:08:21","modified_gmt":"2022-12-14T22:08:21","slug":"ac-javascript-events","status":"publish","type":"page","link":"https:\/\/test.serviceobjects.com\/docs\/dots-global-address-complete\/ac-javascript-events\/","title":{"rendered":"AC &#8211; JavaScript Events"},"content":{"rendered":"\n<div style=\"height:29px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/test.serviceobjects.com\/docs\/dots-global-address-complete\/ac-javascript-events\/#AC-JavaScriptEvents-Events\">Events<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/test.serviceobjects.com\/docs\/dots-global-address-complete\/ac-javascript-events\/#AC-JavaScriptEvents-EventsTable\">Events Table<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"AC-JavaScriptEvents-Events\">Events<\/h2>\n\n\n\n<ul class=\"is-style-no-bullets-indented-list wp-block-list\">\n<li>Use events and listeners to listen and react to them during the various phases of a look up.<\/li>\n<\/ul>\n\n\n\n<div style=\"height:31px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>Listen for Events<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">DOTSGlobalAddressComplete.listen(&lt;Event&gt;, &lt;Function (){}&gt;);\n<\/pre>\n\n\n\n<div style=\"height:31px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>Listen for Events Example<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">DOTSGlobalAddressComplete.listen(\"populate\", function(address, variations) {\n    document.getElementById(\"LabelJSON\").innerText = address.FormattedAddress.toUpperCase();\n});<\/pre>\n\n\n\n<div style=\"height:44px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"AC-JavaScriptEvents-EventsTable\">Events Table<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Event<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>load<\/td><td>The control is ready and is now listening to page events.<\/td><\/tr><tr><td>show<\/td><td>The control is now on the page.<\/td><\/tr><tr><td>hide<\/td><td>The control has been hidden.<\/td><\/tr><tr><td>search<\/td><td>The user is searching. You can modify the&nbsp;searchTerm&nbsp;and&nbsp;lastId&nbsp;of the search object (parameter 1) at this stage.<\/td><\/tr><tr><td>results<\/td><td>Results 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&nbsp;ContainerCount.<\/td><\/tr><tr><td>noresults<\/td><td>No matching results were returned from the find service.<\/td><\/tr><tr><td>display<\/td><td>The suggestions have been shown to the user.<\/td><\/tr><tr><td>select<\/td><td>The user has selected a suggestion. The chosen suggestion can be accessed (parameter 1).<\/td><\/tr><tr><td>prepopulate<\/td><td>The 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.<\/td><\/tr><tr><td>populate<\/td><td>The 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).<\/td><\/tr><tr><td>country<\/td><td>The country has been changed. The selected country object (parameter 1) with&nbsp;iso2,&nbsp;iso3&nbsp;and&nbsp;name&nbsp;properties is passed through.<\/td><\/tr><tr><td>manual<\/td><td>When the&nbsp;manualEntry&nbsp;option is passed through and the user selects the option to enter their address manually this event will fire.<\/td><\/tr><tr><td>error<\/td><td>An 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.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<ul class=\"is-style-no-bullets-indented-list wp-block-list\">\n<li>With all the dynamically loading pages on most modern websites, it may become necessary to load the control manually in the JavaScript using the following command.<\/li>\n<\/ul>\n\n\n\n<div style=\"height:35px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>Manual Loading<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">DOTSGlobalAddressComplete.load();<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Events Listen for Events Listen for Events Example Events Table Event Description load The control is ready and is now listening to page events. show The control is now on the page. hide The control has been hidden. search The user is searching. You can modify the&nbsp;searchTerm&nbsp;and&nbsp;lastId&nbsp;of the search object (parameter 1) at this stage. [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":2321,"menu_order":5,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-5613","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>AC - JavaScript Events<\/title>\n<meta name=\"description\" content=\"Events Events Table Events Use events and listeners to listen and react to them during the various phases of a look up. Listen for Events\" \/>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"AC - JavaScript Events\" \/>\n<meta property=\"og:description\" content=\"Events Events Table Events Use events and listeners to listen and react to them during the various phases of a look up. Listen for Events\" \/>\n<meta property=\"og:url\" content=\"https:\/\/test.serviceobjects.com\/docs\/dots-global-address-complete\/ac-javascript-events\/\" \/>\n<meta property=\"og:site_name\" content=\"Service Objects | Contact, Phone, Email Verification | Data Quality Services\" \/>\n<meta property=\"article:modified_time\" content=\"2022-12-14T22:08:21+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/test.serviceobjects.com\/docs\/dots-global-address-complete\/ac-javascript-events\/\",\"url\":\"https:\/\/test.serviceobjects.com\/docs\/dots-global-address-complete\/ac-javascript-events\/\",\"name\":\"AC - JavaScript Events\",\"isPartOf\":{\"@id\":\"https:\/\/test.serviceobjects.com\/docs\/#website\"},\"datePublished\":\"2022-11-14T22:31:35+00:00\",\"dateModified\":\"2022-12-14T22:08:21+00:00\",\"description\":\"Events Events Table Events Use events and listeners to listen and react to them during the various phases of a look up. Listen for Events\",\"breadcrumb\":{\"@id\":\"https:\/\/test.serviceobjects.com\/docs\/dots-global-address-complete\/ac-javascript-events\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/test.serviceobjects.com\/docs\/dots-global-address-complete\/ac-javascript-events\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/test.serviceobjects.com\/docs\/dots-global-address-complete\/ac-javascript-events\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/test.serviceobjects.com\/docs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"DOTS Global Address Complete\",\"item\":\"https:\/\/test.serviceobjects.com\/docs\/dots-global-address-complete\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"AC &#8211; JavaScript Events\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/test.serviceobjects.com\/docs\/#website\",\"url\":\"https:\/\/test.serviceobjects.com\/docs\/\",\"name\":\"Service Objects | Contact, Phone, Email Verification | Data Quality Services\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/test.serviceobjects.com\/docs\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/test.serviceobjects.com\/docs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/test.serviceobjects.com\/docs\/#organization\",\"name\":\"Service Objects | Contact, Phone, Email Verification | Data Quality Services\",\"url\":\"https:\/\/test.serviceobjects.com\/docs\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/test.serviceobjects.com\/docs\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/test.serviceobjects.com\/docs\/wp-content\/uploads\/2022\/08\/SO-logo-2560px-transparent.png\",\"contentUrl\":\"https:\/\/test.serviceobjects.com\/docs\/wp-content\/uploads\/2022\/08\/SO-logo-2560px-transparent.png\",\"width\":2560,\"height\":1440,\"caption\":\"Service Objects | Contact, Phone, Email Verification | Data Quality Services\"},\"image\":{\"@id\":\"https:\/\/test.serviceobjects.com\/docs\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"AC - JavaScript Events","description":"Events Events Table Events Use events and listeners to listen and react to them during the various phases of a look up. Listen for Events","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"AC - JavaScript Events","og_description":"Events Events Table Events Use events and listeners to listen and react to them during the various phases of a look up. Listen for Events","og_url":"https:\/\/test.serviceobjects.com\/docs\/dots-global-address-complete\/ac-javascript-events\/","og_site_name":"Service Objects | Contact, Phone, Email Verification | Data Quality Services","article_modified_time":"2022-12-14T22:08:21+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/test.serviceobjects.com\/docs\/dots-global-address-complete\/ac-javascript-events\/","url":"https:\/\/test.serviceobjects.com\/docs\/dots-global-address-complete\/ac-javascript-events\/","name":"AC - JavaScript Events","isPartOf":{"@id":"https:\/\/test.serviceobjects.com\/docs\/#website"},"datePublished":"2022-11-14T22:31:35+00:00","dateModified":"2022-12-14T22:08:21+00:00","description":"Events Events Table Events Use events and listeners to listen and react to them during the various phases of a look up. Listen for Events","breadcrumb":{"@id":"https:\/\/test.serviceobjects.com\/docs\/dots-global-address-complete\/ac-javascript-events\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/test.serviceobjects.com\/docs\/dots-global-address-complete\/ac-javascript-events\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/test.serviceobjects.com\/docs\/dots-global-address-complete\/ac-javascript-events\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/test.serviceobjects.com\/docs\/"},{"@type":"ListItem","position":2,"name":"DOTS Global Address Complete","item":"https:\/\/test.serviceobjects.com\/docs\/dots-global-address-complete\/"},{"@type":"ListItem","position":3,"name":"AC &#8211; JavaScript Events"}]},{"@type":"WebSite","@id":"https:\/\/test.serviceobjects.com\/docs\/#website","url":"https:\/\/test.serviceobjects.com\/docs\/","name":"Service Objects | Contact, Phone, Email Verification | Data Quality Services","description":"","publisher":{"@id":"https:\/\/test.serviceobjects.com\/docs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/test.serviceobjects.com\/docs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/test.serviceobjects.com\/docs\/#organization","name":"Service Objects | Contact, Phone, Email Verification | Data Quality Services","url":"https:\/\/test.serviceobjects.com\/docs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/test.serviceobjects.com\/docs\/#\/schema\/logo\/image\/","url":"https:\/\/test.serviceobjects.com\/docs\/wp-content\/uploads\/2022\/08\/SO-logo-2560px-transparent.png","contentUrl":"https:\/\/test.serviceobjects.com\/docs\/wp-content\/uploads\/2022\/08\/SO-logo-2560px-transparent.png","width":2560,"height":1440,"caption":"Service Objects | Contact, Phone, Email Verification | Data Quality Services"},"image":{"@id":"https:\/\/test.serviceobjects.com\/docs\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/test.serviceobjects.com\/docs\/wp-json\/wp\/v2\/pages\/5613","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/test.serviceobjects.com\/docs\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/test.serviceobjects.com\/docs\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/test.serviceobjects.com\/docs\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/test.serviceobjects.com\/docs\/wp-json\/wp\/v2\/comments?post=5613"}],"version-history":[{"count":19,"href":"https:\/\/test.serviceobjects.com\/docs\/wp-json\/wp\/v2\/pages\/5613\/revisions"}],"predecessor-version":[{"id":7922,"href":"https:\/\/test.serviceobjects.com\/docs\/wp-json\/wp\/v2\/pages\/5613\/revisions\/7922"}],"up":[{"embeddable":true,"href":"https:\/\/test.serviceobjects.com\/docs\/wp-json\/wp\/v2\/pages\/2321"}],"wp:attachment":[{"href":"https:\/\/test.serviceobjects.com\/docs\/wp-json\/wp\/v2\/media?parent=5613"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}