Infusion components are configured using options that are defined by the component developer and customized by the integrator. While component developers are free to define whatever options are appropriate for their component, the Infusion Framework supports a number of predefined options. This page briefly describes these predefined options and provides links more information about the related Framework functionality.Some predefined options should not be overridden by integrators: They are strictly for the use of the component developer. This is noted in the descriptions below. Options Supported By All Components GradesThe following options are supported by all component grades: Table of Content Zone |
---|
| gradeNames Div |
---|
| Description | An array of string grade names. |
---|
Notes | In addition to the grade names, the array should include the special "autoInit" value, which instructs the Framework to create the component creator function automatically. NOTE: "autoInit" is the preferred way of creating components, and will become the default for Infusion 2.0. Always use this grade name, unless you have a special reason to not want the framework to fabricate a creator function (perhaps, because your grade is not instantiable). |
---|
Example Definition | Code Block |
---|
| fluid.defaults("component.name", {
gradeNames: ["fluid.modelComponent", "fluid.eventedComponent", "autoInit"],
...
}); |
|
---|
See also | Component Grades |
---|
|
nickName Div |
---|
| Description | An array of string grade names. | Notes | In addition to the grade names, the array should include the special "autoInit" value, which instructs the Framework to create the component creator function automatically. NOTE: "autoInit" is the preferred way of creating components, and will become the default for Infusion 2.0. Always use this grade name, unless you have a special reason to not want the framework to fabricate a creator function (perhaps, because your grade is not instantiable)Specifies a custom nickname for the component. The nickname is used by the Framework as an extra context name which can reference the component. By default, the nickname is derived from the component name. |
---|
Notes | This option was historically used to work around various framework deficiencies that have now been corrected. It will be removed from an upcoming revision of the framework. |
---|
Example Definition | Code Block |
---|
| fluid.defaults("component.name", {
gradeNamesnickName: ["fluid.modelComponent", "fluid.eventedComponent", "autoInit"]myComponentName",
...
}); |
|
---|
See also | Component Grades |
---|
|
nickName Div |
---|
| Description | Specifies a custom nickname for the component. The nickname is used by the Framework as an extra context name which can reference the component. By default, the nickname is derived from the component name. |
---|
Notes | This option was historically used to work around various framework deficiencies that have now been corrected. It may be removed from an upcoming revision of the frameworkfluid.computeNickName |
---|
|
mergePolicy Div |
---|
| Description | An object providing instructions for how particular options should be merged when integrator options are merged with default values. |
---|
Notes | It is uncommon to need this option. The most common use case is to protect "exotic values" derived from some external library or framework from being corrupted by the options merging/expansion process by use of the "nomerge" policy. |
---|
Example Definition | Code Block |
---|
| fluid.defaults("component.name", {.defaults("component.name", {
mergePolicy: {
option1: "noexpand",
nickNameoption2: "myComponentName"nomerge",
....
},
...
}); |
|
---|
See also | fluid.computeNickName |
---|
| mergePolicyinvokers Div |
---|
| Description | An object providing instructions for how particular options should be merged when integrator options are merged with default values. |
---|
Notes | It is uncommon to need this option. The most common use case is to protect "exotic values" derived from some external library or framework from being corrupted by the options merging/expansion process by use of the "nomerge" policy. |
---|
defining methods on the component whose arguments are resolved from the environment as well as the direct argument list at invocation time. | Notes | |
---|
Example Definition | Code Block |
---|
| fluid.defaults("component.name", {
mergePolicy: {
option1invokers: "noexpand",{
option2inv1: "nomerge"{...},
inv2: {....},
},
...
}); |
|
---|
See also | Options MergingInvokers |
---|
| invokersmembers Div |
---|
| Description | An object defining methods on the component whose arguments are resolved from the environment as well as the direct argument list at invocation time. | Notes | properties to be added to the component object. These can be anything, including methods, strings, objects, etc. Definitions are evaluated as IoC expressions. |
---|
Notes | members differ from invokers in that the arguments of members are not resolved at invocation time. The right-hand-side may contain an expander definition, which may perhaps itself resolve onto an invoker.
|
---|
Example Definition | Code Block |
---|
| fluid.defaults("component.name", {
invokersmembers: {
inv1member1: "{that}.options..}optionsValue",
inv2member2: "{theOther}.dom..}otherSelector",
},
...
}); |
| See also | Invokers |
---|
| memberscomponents Div |
---|
| Description | An object defining properties to be added to the component object. These can be anything, including methods, strings, objects, etc. Definitions are evaluated as IoC expressions. | Notes | members differ from invokers in that the arguments of members are not resolved at invocation time. The right-hand-side may contain an expander definition, which may perhaps itself resolve onto an invoker.containing named definitions of the component's subcomponents.
|
---|
Notes | This (the subcomponent record) is one of the core sources from which the options configuring a component in a particular context. The total set of options sources are: i) the original defaults record, ii) the subcomponent record, iii) direct user options (supplied to a component creator function), iv) distributed options |
---|
Example Definition | Code Block |
---|
| fluid.defaults("component.name", {.name", {
components: {
members subcomponent1: {
member1 type: "{that}.options.optionsValuecomponent.subcomp1",
member2 options: "{theOther}..dom.otherSelector",.}
},
...
},
...
}); |
|
---|
| componentsdynamicComponents Div |
---|
| Description | An object containing named definitions of the component's dynamic subcomponents. |
---|
Notes | This (the subcomponent record) is one of the core sources from which the options configuring a component in a particular context. The total set of options sources are: i) the original defaults record, ii) the subcomponent record, iii) direct user options (supplied to a component creator function), iv) distributed options | Example Definition | Code Block |
---|
| javascript | javascript | fluid.defaults("component.name", {
components: {Some special context names may be available within the subcomponent's definition block, for example {source} and {sourcePath} or {arguments} . This framework facility will be replaced by a more declarative equivalent in time and should be used with caution.
---|
Example Definition | Code Block |
---|
fluid.defaults("component.name", {
dynamicComponents: {
dynamic1: {
type: "component.subcomp1",
source: "{context}.someArray",
subcomponent1 options: {...}
},
type: "component.subcomp1",...
},
options: {...}
},
...
},
...
}); |
|
---|
See also | Tutorial - Subcomponents |
---|
|
dynamicComponents Div |
---|
| | Description | An object containing named definitions of the component's dynamic subcomponents |
---|
Notes | Some special context names may be available within the subcomponent's definition block, for example {source} and {sourcePath} or {arguments} . This framework facility will be replaced by a more declarative equivalent in time and should be used with caution. |
---|
Example Definition | Code Block |
---|
fluid.defaults("component.name", {
dynamicComponents: {
dynamic1: {
type: "component.subcomp1",
source: "{context}.someArray",
options: {...}
},
...
},
...
}); |
|
---|
See also | Tutorial - Subcomponents |
---|
Little ComponentsComponents defined with a grade of littleComponent support all of the common options described above, and no others. Component developers are free to define their own additional options.See also: Component Grades Model ComponentsComponents defined with a grade of modelComponent/modelRelayComponent support all of the common options described above, as well as those defined below. Component developers are free to define their own additional options.See also: Component Grades The following options are supported by model components: Table of Content Zone |
---|
|