Child pages
  • Component Lifecycle

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

Version 1.4 of Infusion introduces Inversion of Control (IoC), and with it, new techniques for component creation, and a new component lifecycle. For information on this, see:

The information on this page is still accurate, and the techniques described here will continue to be supported until at least v2.0 of Infusion, but we recommend you use the new IoC methods.

Section
Column
width60%

This page outlines the sequence of events in the instantiation of a Fluid component. Some of these events are the responsibility of the runtime, some, of the user, and some, of the Fluid framework.

Setting up a Fluid component

Defining a component requires two steps:

  1. Registering the component's default options with the framework by issuing a call to fluid.defaults.
  2. Defining a suitably namespaced creator function which constructs the component.

These two actions may be performed in any order, since none of the code in the creator function will execute until the component is instantiated. As well as general default options, fluid.defaults also sets up the structure for particularly meaningful component configuration such as events, DOM binding selectors and subcomponents. This section of the process is covered by the Fluid Component API page.

Column
Panel
borderColor#566b30
bgColor#fff
titleBGColor#D3E3C4
titleOn This Page
borderStylesolid
Table of Contents
minLevel2
maxLevel5
Panel
borderColor#321137
bgColor#fff
titleBGColor#c1b7c3
titleSee Also
borderStylesolid

...

A component may express a stronger contract by representing itself as model-bearing, which is described in Fluid Component API and Component Model Interactions and API. It is probable that a future version of the Infusion framework will assist this by supplying an initialisation directive initModel to accompany initView, in association with the ChangeApplier