Asynchronous Client Loader Builder

 

 

In this topic ...

How do I...

Specifying Inputs

Objects this Builder Creates

This builder converts all of the actions in an existing model so that they execute without causing the top-level page to re-load in the browser. This is especially useful in a composite application composed of several portlets running in a portal. This builder allows operations in one portlet to execute independently of other portlets, thus eliminating the need to reload and re-render the entire application.

This builder is also useful when:

  • A portlet loads slowly - This might be caused by latency in a back-end database. Using this builder will cause a slow-loading portlet to immediately display a short "Loading..." message and then render itself once loading is complete.

  • A portlet tries to automatically refresh data - This builder allows you to use client JavaScript to reload a portlet page on a regular basis, without invoking or involving other portlets in the application.

This builder wraps all pages with JSP code that uses an if-then-else pattern: if the request input ".bst_render" is found, display the original page contents; otherwise, send back some JavaScript and a hidden IFRAME tag. In the "else" clause above, the IFRAME is set to re-load the same page, passing the ".bst_render" request parameter in the query string, and it has an onload event handler that will copy the contents of the IFRAME onto the main page for display.

The builder also arranges for a special URL Mapper to be used when generating action URLs. This mapper creates JavaScript URL s that re-target the hidden IFRAME instead of acting directly.

 

How do I...

 

Convert my model to use asynchronous client loading?

Add an Asynchronous Client Loader Builder call to your model. Conversion will be automatic.

Optionally, specify a name for this builder call. This name is applied to the linked Java object created by this builder.

Rebuild and deploy the project to the portal server and observe asynchronous loading of the portlet.

 

Specifying Inputs

This builder takes the inputs described in the table below. For help on inputs common to many or all Builders such as those in the Properties input group, see "Using the Builder Call Editor"

Input Name Description
Name Enter a name for this Builder call. The Designer displays this name in the Builder Call List.

Note that The name you provide will be used as a prefix for the runtime support linked Java object and associated initialize method.

 

Objects This Builder Creates

This builder does not create objects that we can manipulate. It does place the following artifacts in the WebApp:

 

Linked Java Objects

  • <buildername>Helper Runtime support linked Java object, including URL Mapper.

 

Methods

  • <buildername>OnLoadHandler WebApp OnLoad handler that initializes the above linked Java object.