Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
Include Page
Infusion14:sneak peek warningInfusion14:
sneak peek warning

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


{section}
{column:width=70%}
Initializes any dependent subcomponents and [invokers|Invokers] specified in the options for a component.
{code:javascript|borderStyle=none|bgColor=white}
fluid.initDependents(that);
{code}
*File name:* {{FluidIoC.js

Parameters

}}

h2. Parameters

{span:class=borderless-table
}
|*{{that}}*| (Object) the {{that}} object of the parent
component

Return Value

Div
class
Wiki Markup
{div:class=api-page
}

h1. fluid.initDependents(that)
Section
Column
width70%
Code Block
javascriptjavascript
bgColorwhite
borderStylenone
Span
class

that

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 Blockjavascriptjavascript
 component |
{span}

h2. Return Value
{span:class=borderless-table}
|*None*|  |
{span}

{column}

{column:width=5%}
{column}

{column}
h3. See Also
* [fluid.demands]
* [fluid.defaults]
* [Invokers]
* [How to Use Infusion IoC]
{column}
{section}
----
h3. 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()}}|fluid.demands]. For more information on this relationship, please see [How to Use Infusion IoC].

h3. Example
{span:class=borderless-table}
|{code: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"
        }
    }
});
{code}|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|fluid.demands] for details about that function).|
{span}
{div}