getSelectedObjects()

The selected objects in the host, normalized identically in both clients. One of the seven portable facade methods of the Dashlet handle — see call for the string-based surface, which shares the same dispatch core.

1. Signature

getSelectedObjects(): Promise<SelectedObjectRef[]>;

Each result element is an SelectedObjectRef ({ objectId, objectTypeId } — type details: SelectedEntry).

2. Parameters

None.

3. Per-environment behavior

Environment Behavior

webclient

Posts getSelectedObjects with empty params (correlated). Resolves the host’s array directly — ids may arrive as strings or numbers depending on the host.

rich client

osjxGetSelectedObjects() returns a raw bridge string ("osid,objectTypeId;…", "" when nothing is selected), which is parsed and normalized: an empty selection resolves []; phantom (osid 0) and malformed (osid null) tuples are dropped (parity with the init path); typeless documents carry the -1 type marker.

standalone (or still detecting without a wire)

No host reply path exists — the call rejects (bounded) with the TimeoutError so callers can render a fallback instead of hanging.

4. Examples

const selected = await dashlet.getSelectedObjects();
// e.g. [{ objectId: 1024, objectTypeId: 262145 }, …]

5. Errors

  • Error('dashlet destroyed') — the dashlet was destroyed before the call.

  • TimeoutError — bounded no-reply in standalone, or a host that never answered within timeoutMs.

  • The host’s { error } payload — when the host reports a failure on the webclient method call.