Skip to main content
Version: 1.x

Interface: UI5ControlBase

Defined in: src/core/types/controls.ts:45

Base interface all UI5 controls extend.

Remarks

Maps to sap.ui.core.Element / sap.ui.core.Control base methods. All methods return Promise<T> because they execute via the bridge adapter in the browser context.

Example

import type { UI5ControlBase } from '#core/types/controls.js';

async function logControl(control: UI5ControlBase): Promise<void> {
const id = await control.getId();
const type = await control.getControlType();
logger.info(`${type}#${id}`);
}

Indexable

[method: string]: any

Dynamic method access — the proxy forwards any UI5 method call to the bridge.

Remarks

UI5 controls have hundreds of methods (getters, setters, actions) that vary by control type. The runtime Proxy intercepts property access and routes it through page.evaluate(). This index signature allows TypeScript to accept any method call without requiring explicit type narrowing.

any is required here because the Proxy returns heterogeneous types per property: string for id/controlType, undefined for anti-thenable, and (...args) => Promise for dynamic methods. No single non-any type can express this while remaining compatible with the typed members above.

Example

const button = await ui5.control({ id: 'btn1' });
await button.press(); // sap.m.Button method
await button.getText(); // sap.m.Button method
const table = await ui5.control({ id: 'tbl1' });
const rows = await table.getRows(); // sap.ui.table.Table method

Properties

controlType

readonly controlType: string

Defined in: src/core/types/controls.ts:47

Fully qualified control type, e.g., 'sap.m.Button'.


id

readonly id: string

Defined in: src/core/types/controls.ts:49

Control ID assigned in the UI5 view or generated.

Methods

getAggregation()

getAggregation(name): Promise<readonly UI5ControlBase[]>

Defined in: src/core/types/controls.ts:65

Returns controls in a named aggregation.

Parameters

name

string

Returns

Promise<readonly UI5ControlBase[]>


getBindingInfo()

getBindingInfo(name): Promise<unknown>

Defined in: src/core/types/controls.ts:67

Returns binding info for a named property.

Parameters

name

string

Returns

Promise<unknown>


getControlType()

getControlType(): Promise<string>

Defined in: src/core/types/controls.ts:59

Returns the fully qualified control type name.

Returns

Promise<string>

Remarks

Praman proxy convenience — equivalent to getMetadata().getName() in native UI5.


getDomRef()

getDomRef(): Promise<Element | null>

Defined in: src/core/types/controls.ts:69

Returns the DOM reference element, or null if not rendered.

Returns

Promise<Element | null>


getId()

getId(): Promise<string>

Defined in: src/core/types/controls.ts:52

Returns the control's ID.

Returns

Promise<string>


getModel()

getModel(name?): Promise<unknown>

Defined in: src/core/types/controls.ts:75

Returns the named model, or the default model if no name given.

Parameters

name?

string

Returns

Promise<unknown>


getProperty()

getProperty(name): Promise<unknown>

Defined in: src/core/types/controls.ts:61

Gets a named property value.

Parameters

name

string

Returns

Promise<unknown>


getVisible()

getVisible(): Promise<boolean>

Defined in: src/core/types/controls.ts:71

Returns whether the control is visible (getVisible() on sap.ui.core.Control).

Returns

Promise<boolean>


isBound()

isBound(propertyName): Promise<boolean>

Defined in: src/core/types/controls.ts:73

Returns whether a property is data-bound.

Parameters

propertyName

string

Returns

Promise<boolean>


setProperty()

setProperty(name, value): Promise<void>

Defined in: src/core/types/controls.ts:63

Sets a named property value.

Parameters

name

string

value

unknown

Returns

Promise<void>