This documentation is archived and is not being maintained.

Sys.Application.getComponents Method

Visual Studio 2008

Returns an array of all components that have been registered with the application by using the addComponent method. This member is static and can be invoked without creating an instance of the class.

var componentArray = Sys.Application.getComponents();

An array that contains all components that have been registered with the application by using the addComponent method.

Use the getComponents function to retrieve an array of all components that have been registered with the client application by using the addComponent method.

The following example retrieves registered components and writes their ID and type information to a <div> element.

function listComponents() {
    var c = Sys.Application.getComponents();
    var s = "";
    for (var i=0; i<c.length; i++) {
        var id = c[i].get_id();
        var type = Object.getType(c[i]).getName();
        s += 'Item ' + i + ': id=' + id + ', type=' + type + '.<br />';
    }
    div1.innerHTML = s;
}
Show: