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.

In the Infusion IoC system, a component can declare its subcomponents through the components property of the defaults, using fluid.defaults:

fluid.defaults("my.component.name", {
    ...
    components: {
        subcomponent1: <subcomponent declaration>,
        subcomponent2: <subcomponent declaration>,
        subcomponent3: <subcomponent declaration>,
    },
    ....
});

Basic Subcomponent Declaration

The subcomponent declaration has the following basic form:

fluid.defaults("my.component.name", {
    ...
    components: {
        subcomponent1: {
            type: "type.name"
            options: {...},
        }
    },
    ....
});

In this form of the declaration, the properties are:

Property

Description

Example

type

This is a string representing the type of subcomponent to use. It will generally be the string used as the demandingName argument to fluid.demands, but it could also be the actual function name of the subcomponent. These variations will be described further below.

subcomponent1: {
    type: "fluid.mySubcomponent"
}

options (Optional)

These are options to be passed to the subcomponent as "user options." Note that these are not the default options for the subcomponent. Any defaults should be declared in a separate fluid.defaults call.

subcomponent1: {
    type: "fluid.mySubcomponent",
    options: {
        myOptions: "{name}.options.someOption",
        ...
    }
}

createOnEvent (Optional)

Specifies the event object that will trigger the creation of the subcomponent when it is required for the subcomponent to be created at the time (later) other than during the call to fluid.initDependents of the parent component.

subcomponent1: {
    type: "fluid.mySubcomponent",
    createOnEvent: "someEvent"
}

priority (Optional)

Specifies the order priority of the creation of the particular subcomponent. During the execution of fluid.initDependents the framework will sort the collection of subcomponents based on the priority specified.

subcomponent1: {
    type: "fluid.mySubcomponent",
    priority: "first"
}

Subcomponent Types

... to come ...

  • No labels