|
ComponentBase
|
Method Summary
| Type | Method and Description |
| GenericComponentBase |
as(ComponentType type)
Casts the component to the specified type. |
| ComponentType |
getComponentType()
Returns the component type of the component. |
| String |
getName()
Returns the component name. |
Method Detail
| as | ||||
GenericComponentBase as(ComponentType type)undefined is returned.
Example
In the following example, elements of a ComponentArray are cast as elements of
Button:
// a is now a ComponentArray a.forEach(function(element) { var b = element.as(ComponentType.BUTTON); if (b !== undefined) { // we found a button b.setText("Hello"); } });
Parameters
Returns
GenericComponentBase–It contains the component, cast to the specified type, or undefined if the component
could not be cast to the specified type. |
| getComponentType |
|
ComponentType getComponentType()
Example
In the following example, the type of a button is retrieved:
Returns
ComponentType–It contains the type of the component. |
| getName |
|
String getName()
Example
In the following example, the name of a Button is retrieved:
Returns
String–It contains the name of the component. |