Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Custom HTML documents enable you to create your own tables within the Pulsar FSL environment. These pages have full access to the Pulsar JSAPI bridge, enabling you to modify and display data as you see fit.

Accessing the Bridge

The 3-2. Pulsar Platform - JS Bridge API is fully accessible from any custom document running in the Pulsar FSL environment.

var bridge = window.parent.pulsar.bridge;

var request = { 
    "type"   : "read",
    "object" : "Account",
    "data"   : { "Name" : "John Doe Industries" }
};
bridge.sendRequest(request, function (responseData) { 
  alert('Request Result: ' + responseData); 
});

This means of accessing the bridge is different from custom documents running outside of FSL in Pulsar. Outside of the FSL context, the bridge has not yet been initialized and registration code must be executed. Consider limiting your use cases to one style, though it is possible to create a hybridized bridge set up function.

Pulsar FSL Functions

In order to allow for rich user experience, Pulsar exposes a number of FSL specific methods in addition to the bridge.

var pulsar = window.parent.pulsar;

// Go back to the previous Pulsar page
// * only relevant to pages launched from a Pulsar SObject page
// * Tab bar pages will be the "root" of that tab, so back will be ignored
pulsar.goBack();

// Open another custom document
pulsar.displayContentDocument(aDocumentId, { "someParameter": "a value" }, function () {
  alert("Document has been displayed.");
});

// Show/Hide a Spinner that disables the Pulsar FSL UI
pulsar.showSpinner();
// do some time consuming work
pulsar.hideSpinner();


// Show/Hide the Pulsar FSL navigation bar
pulsar.hideNavBar();
// Your page is responsible for re-displaying the navigation bar
pulsar.showNavBar();

Page and Component Resizing

Documents are displayed within iFrames in the Pulsar FSL document. The size of this iFrame is based upon the size of the content. However, there are cases in which a document may have a dynamic size or one that is created after the iFrame has sized itself. In these cases, we make use of the javascript postMessage function.

// Once you have determined the height you'd like the iFrame to conform to...
// inform Pulsar FSL of that height formatted as you would CSS.
var myHeight = "800px";

window.parent.postMessage({
  "type": "refresh",
  "height": myHeight,
}, "*");

// Note: sending "*" as the origin is acceptable since this will never carry sensitive data

  • No labels