We provide a javascript SDK that you can check here. We recommend to use it within the App's page as showcased in the Hello App.

This section describes the functions it exposes in more detail.

Available functions

Currently, our javascript SDK exposes the following functions:

Function Short description
 init

  Initializes the iframe using an optional associative array that contains:

  • mainDivId: the main div in your iframe.  it is used to process the height and width of the iframe.
  • targetOrigin: URL of your Apps host
 redirect

  Redirect to a page in Boondmanager. It can take relative URLs as paramaters

 setSize   Sets the height of the iframe.
 setAutoResize   Sets the size to the dimensions of the mainDivId.
 scrollTo   Performs a scroll in Boondmanager.
 confirm   Displays a confirmation modale and returns a Promise with the user's choice.
 alert   Displays an information modale
 setSaveButtonEnabled   Enables/Disables the save button in the current Form displayed within Boondmanager.
 onBeforeSave   Hook triggered before saving. If it returns false the execution is interrupted.
 onBeforeValidate   Hook triggered before validating i-e validating a times reports for exemple. If it returns false the execution is interrupted.
 onAfterSave   Hook triggered after saving. Does not interrupt execution.
 onAfterValidate   Hook triggered after validating. Does not interrupt execution.
 getModel   Retrieves the model of the current view.

 

Usage

Loading the SDK in your App

Using script tags:

Using script tags:

<script type="text/javascript" src="https://ui.boondmanager.com/sdk/boondmanager.js"></script>

If by any chance this URL returns a 404, please notify us. You can always import the file directly after downloading the latest version which is available on Gihub

<script type="text/javascript" src="boondmanager.js"></script>


Handling IE specifics: put this snippet in the Body of your page

<div id="div_mask"></div>
<div id="div_modalmessage"></div>
<script type="text/javascript">
    if (navigator.appName=='Microsoft Internet Explorer')
        document.write('<iframe id="frame_mask" frameborder="0" scrolling="no" src="about:blank" style="filter:alpha(opacity=0);"></iframe>');
</script> <div id="frame_output"> <!-- Your own HTML Code --> </div>

 

Initialization:

Your page will be displayed in an iFrame. Put the following code in the Body of your page.

<script type="text/javascript">
BoondManager.init({
targetOrigin : '*'
}).then(() => {
BoondManager.setAutoResize();
});
</script>

 

 

Initializing  the App

Initializing the App has to be the first call made to an SDK function. The init() function has the following parameters:

parameter Description Type
  payload

  A JSON Object with the following optional attributes :

  • mainDivId: Id of the main div in your iframe.  it is used to process the height and width of the iframe.
  • targetOrigin: URL of your Apps host, the origin of your App's parent window.
Object

 

BoondManager.init(payload);

 

Showing an alert modal

The alert() function has the following parameters:

parameter Description Type
  alert_message

  An HTML message

String
  title

  The title of the modal

String
  bOK

 Javascript to execute when user will click on [Ok] button 

String 

 

BoondManager.alert(alert_message, title, bOK)

 

Showing a confirmation modal

The confirm() function has the following parameters:

parameter Description Type
  confirm_message

  An HTML message

String
  title

  The title of the modal

String
  bYES

 Javascript to execute when user will click on [Ok] button 

String 
  bNO

 Javascript to execute when user will click on [No] button 

String 

 

BoondManager.confirm(confirm_message, title, bYES, bNO)

 

Redirecting to another page

The redirect() function has the following parameters:

parameter Description Type
  url

  The target URL

String

 

BoondManager.redirect(url)

 

Resizing the parent's iFrame to the correct height

The setAutoResize() function cannot be used when the App has an access button from an iFrame

It has not parameters :

BoondManager.setAutoResize();

 

Resizing the parent's iFrame to a specific height

The setSize() function cannot be used when the App has an access button from an iFrame

It has the following parameters:

parameter Description Type
  height

 Specific height in pixels

Integer

 

BoondManager.setSize(height);

 

Scrolling the parent's iFrame to a specific position

 The scrollTo() function has the following parameters:

parameter Description Type
  height

  Specific height in pixels

Integer

 

BoondManager.scrollTo(height)

 

Cet article vous a-t-il été utile ?
Utilisateurs qui ont trouvé cela utile : 0 sur 0

Commentaires

0 commentaire

Cet article n'accepte pas de commentaires.