Compartilhar via


Sys.Application.addComponent Method

Registers a component with the application and initializes it if the component is not already initialized. This member is static and can be invoked without creating an instance of the class.

Sys.Application.addComponent(component);

Arguments

  • component
    An instance of a type derived from the Component class to register with the client application.

Exceptions

Exception type

Condition

Error.invalidOperation Function

(Debug) component does not contain a valid ID.

Remarks

Use the addComponent function to register a component with the application and to initialize it if the component is not already initialized.

Registering a component with the application also enables you to get a reference to the component or to verify that it exists. By using the Sys.Application.findComponent method of the Sys.Application class or the $find shortcut method, you can search for registered components in the application or in any subcomponent hierarchy.

See Also

Reference

Sys.Application Class

Other Resources

Language Reference