Load-on-Demand with the fulfill Attribute

The simplest way to defer the creation of the child components is to use the fulfill attribute. For example, the comboitem component in the following code snippet will not be created, until the combobox component receives the onOpen event, indicating comboitem is becoming visible.

<combobox fulfill="onOpen">
    <comboitem label="First Option"/>    
</combobox>

In other words, if a ZUML element is specified with the fulfill attribute, its child elements won't be processed until the event specified as the value of the fulfill attribute is received.

If the event to trigger the creation of children is targeted to another component, you can specify the target component's identifier after colon as depicted below.

<button id="btn" label="show" onClick="content.visible = true"/>
<div id="content" fulfill="btn.onClick">
    Any content created automaticall when btn is clicked    
</div>

If the components belong to different ID space, you can specify a path after the event name as follows.

<button id="btn" label="show" onClick="content.visible = true"/>
<window id="content" fulfill="../btn.onClick">
    Any content created automaticall when btn is clicked    
</window>