Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Div
classapi-page

fluid.initDependents(that)

Section
Column
width70%

Initializes any dependent subcomponents and invokers specified in the options for a component.

Code Block
javascript
javascript
bgColorwhite
borderStylenonejavascript
fluid.initDependents(that);

File name: FluidIoC.js

Parameters

Span
classborderless-table

that

(Object) the that object of the parent component

Return Value

Span
classborderless-table

None

 

Column
width5%

Column

See Also


Notes

fluid.initDependents() examines the components and invokers properties of the parent components options (i.e. that.options.components. If neither of these propertis is found, or is empty, this function will have no effect.

fluid.initDependents() works in conjunction with fluid.demands(). For more information on this relationship, please see How to Use Infusion IoC.

Example

Span
classborderless-table
Code Block
javascript
javascript
myApp.myComponent = function (container, options) {
    var that = fluid.initView("myApp.myComponent", container, options);
    ...
    fluid.initDependents(that);
    ...
    return that;
};
fluid.defaults("myApp.myComponent", {
    components: {
        sub1: {
            type: "myApp.mySubcomponent1"
        },
        sub2: {
            type: "myApp.mySubcomponent2"
        }
    }
});

In this example, the fluid.defaults() call describes two subcomponents, sub1 and sub2 in the components property. The call to fluid.initDependents() will initialize these two subcomponents based on any demands specified through fluid.demands (not shown here: please see the How to Use Infusion IoC for information about how these functions work together, and the fluid.demands() API for details about that function).