Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
createComponents()
Create an array of components from a list of types and attributes.
This method accepts a list of component names and attribute maps, and a callback to notify the
caller.
Signature
createComponents(Array components, function callback)
Parameters
- components
- Type: Array
- The list of components to create. For example, ["lightning:button", {"onclick":component.getReference("c.handlePress")}]
- callback(components, status, errorMessage)
- Type: function
- The callback to invoke after the components are created. The callback has three parameters.
- components—The components that were created. This parameter enables you to do something with the new components, such as add them to the body of the component that created them. If there’s an error, components is null.
- status—The status of the call. The possible values are SUCCESS, INCOMPLETE, or ERROR. Always check that the status is SUCCESS before you try to use the components.
- errorMessage—The error message if the status is ERROR.