Deferred Rendering of a Fragment

The default behavior of a fragment is for it to load/run immediately when it's encountered by the page rendering it. By wrapping a fragment in the <oj-defer> component, you can control when a fragment loads and renders in a page. The fragment can be hidden until loaded by a trigger. The trigger to load a fragment can either be a configurable or it can be determined by the framework. Configurable triggers that can be used to load a fragment include button clicks, tab selection, dialog open, and oj-bind-if components. In this case, UI events or the application state drives the fragment that is loaded.

Deferring the rendering of a fragment can improve performance, so that, for example, an action chain for a hidden fragment is delayed until the fragment is actually loaded. For examples on using oj-defer, see Deferred Rendering in the JET Developer Cookbook.

For examples of using <oj-defer> with <oj-vb-fragment>, see Fragment Patterns below.