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 |
---|---|---|
|
This is a string representing the type of subcomponent to use. It will generally be the string used as the |
subcomponent1: { type: "fluid.mySubcomponent" } |
|
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 |
subcomponent1: { type: "fluid.mySubcomponent", options: { myOptions: "{name}.options.someOption", ... } } |
|
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" } |
|
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 ...