Data Controls Implementation Guide

Data Controls Implementation Guide

JavaScript Messaging in Internet Explorer 7

JavaScript Messaging in Internet Explorer 7

The Duplicate Prevention control sends events to the embedding application by using postmessage plugin. This plugin uses the
window.postMessage
JavaScript function that is not supported by Internet Explorer 7. You must use a workaround based on window location hash polling, by providing the current URL of the parent window embedding Duplicate Prevention control (full URL string displayed in the browser's navigation bar) to the postmessage plugin. This is required for setting the location hash of the target window. You must pass the value of this URL to the Duplicate Prevention control by using one of the following methods:
  • If the URL does not change in your environment, then specify the URL in the bdc-config.xml properties file using the
    parentUrl
    parameter, as shown in the following example:
    <?xml version="1.0" encoding="UTF-8"?> <bdcConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="
    siperian-bdd-config-6.xsd
    "> <property name="parentUrl">http://c.na7.visual.force.com/apex/SomePage</property> </bdcConfiguration>
    The value specified in the properties file must exactly match the URL in the navigation bar of the browser. This value is case-sensitive.
    You cannot use this method if single control instance needs to be embedded in multiple pages with different URLs.
  • If the URL changes in your environment, or if single control instance needs to be embedded in multiple pages with different URLs, then dynamically detect the URLs on the embedding application side and pass it to the control as the
    parentUrl
    parameter inside the URL of the control. The value of the
    parentUrl
    parameter must be double encoded.
    The following example shows a JavaScript code that detects the current URL displayed in the browser and constructs URL of Duplicate Prevention control with
    parentUrl
    parameter to embed it into the HTML page iFrame with control:
    // get current URL var parentUrl = document.location.href; // double encode URL using standard JavaScript function ‘encodeURIComponent’ parentUrl = encodeURIComponent(encodeURIComponent(parentUrl)); // embed into the page iframe with Duplicate Prevention control document.writeln('<iframe src="http://<host>:<port>/bdd/bdc/<component name>/sa:<subject area>,<match parameters>,parentUrl:' + parentUrl + '/proactive_match/component.jsf" </iframe>');
Also, Internet Explorer 7 has restrictions on the size of the imported data. In Internet Explorer 7, an URL cannot be more than 2083 characters in size. The string with data is truncated and a JavaScript error is displayed if the URL and the imported data do not comply with the size restriction.

0 COMMENTS

We’d like to hear from you!