Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
{div:class=} {
Wiki Markup
Div
classtutorial-linear-nav

Span

:

class

=

tutorial-nav-left

}*

Previous:

* [

Pick

a

component

type

]{span} {span:class=

Span
classtutorial-nav-centre

}[

Up

to

overview|Tutorial - Getting started with Infusion]{span} {span:class=

overview
Span
classtutorial-nav-right

}*

Next:

* [

Model

Components]{span} {div}
Wiki Markup
{div:class=floatRight}
{panel:title= On This Page| borderStyle=solid| borderColor=#ccc| bgColor=#fff}
{toc:minLevel=2|maxLevel=5}
{panel}
{div}
Wiki Markup
{div:class=floatRight} {panel:title= See Also| borderStyle=solid| borderColor=#ccc| bgColor=#fff} [Component Grades] [fluid.defaults] [Options Merging] [Inversion of Control (IoC)] [Component Lifecycle and autoInit] {panel} {div}

Components

Div
classfloatRight
Panel
borderColor#ccc
bgColor#fff
titleOn This Page
borderStylesolid
Table of Contents
minLevel2
maxLevel5
Div
classfloatRight
Panel
borderColor#ccc
bgColor#fff
titleSee Also
borderStylesolid

Component Grades
fluid.defaults
Options Merging
IoC - Inversion of Control
Component Lifecycle and autoInit

Regardless of which grade of component you use, the basic structure will be the same. We'll use the simplest grade, a little component, to illustrate what this structure is. In future pages explaining other grades, you'll see the same principles.

...

  1. directly: You write the function yourself
  2. using IoC - Inversion of Control (IoC): The framework will create the function according to your specifications

...

Automatic creator function generation

The IoC - Inversion of Control (IoC) system can automatically generate a component creator function for you. This is accomplished by added a special grade to the gradeNames property: "autoInit":

...

Code Block
javascript
javascript
fluid.defaults("tutorials.currencyConverterAuto", {
    gradeNames: ["fluid.littleComponent", "autoInit"],
    exchangeRate: 1.035,
    finalInitFunction: "tutorials.currencyConverterAuto.finalInit"
});

// The final init function
tutorials.currencyConverterAuto.finalInit = function (that) {
    that.convert = function (amount) {
        return amount * that.options.exchangeRate;
    }
};
{div:class=} {
Wiki Markup
Div
classtutorial-linear-nav

Span

:

class

=

tutorial-nav-left

}*

Previous:

* [

Pick

a

component

type

]{span} {span:class=

Span
classtutorial-nav-centre

}[

Up

to

overview|Tutorial - Getting started with Infusion]{span} {span:class=

overview
Span
classtutorial-nav-right

}*

Next:

* [

Model

Components

]{span} {div}