Documentation for a historical release of Infusion: 1.4
Please view the Infusion Documentation site for the latest documentation, or the Infusion 1.3. Documentation for the previous release.
If you're looking for Fluid Project coordination, design, communication, etc, try the Fluid Project Wiki.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

This functionality is Sneak Peek status. This means that the APIs may change. We welcome your feedback, ideas, and code, but please use caution if you use this new functionality.

fluid.initDependents(that)

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

fluid.initDependents(that);

File name: FluidIoC.js

Parameters

that (Object) the that object of the parent component

Return Value

None  

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

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).
  • No labels