+

Search Tips   |   Advanced Search

Deferred and nondeferred modules


The module framework allows a profile to specify whether to defer a particular module. By default, a module is loaded when the initial page loads, but modules specified as deferred modules are loaded after the page loads.

Nondeferred modules are enabled whenever a request for a page is made to the portal servlet resulting in a full page refresh. Use a client-side JavaScript module to load resources associated with deferred modules on demand.

For example, load deferred modules when entering edit mode for a page. Resources that are not required in view mode can be lazy loaded when the page mode is changed to edit.

If you enter edit mode while using the deferred profile available out of box, the following error displays when using a JavaScript console: dojo.back.init() must be called before the DOM has loaded. If using xdomain loading or djConfig.debugAtAllCosts, include dojo.back in a build layer. This error is thrown by dojo because the dojo.back package is loaded in a deferred way. This code path is used only by older browsers which are no longer supported. This JavaScript error has no affect on functionality.

If a nondeferred module requires a deferred module, the server-side combiner framework promotes the deferred module to be nondeferred. The promoted module is then loaded during the initial page rendering process. The module is not deferred, and all of its contributions to each extension point are displayed in view mode. The contributions are not included when any remaining deferred modules are loaded later.

Because deferred modules are loaded distinctly after a page loads, the types of resources that can be deferred are necessarily a subset of what can be loaded. CSS, JavaScript code, and markup can be deferred. Therefore, the following rules define when contributions to various places are loaded for deferred modules.

Do not use portal render request-dependent attributes, because there is no guarantee that those attributes are available in all cases.

For example, when used in deferred mode, the render context is not available.


Parent: The module framework