call()
The string-based entry point for host methods on the
Dashlet handle. It is a thin passthrough: the seven
portable method names route through the same dispatch core as the typed
facade, so the two surfaces cannot drift; any other name follows the
host-specific raw path — the documented escape hatch of the respective
handle (webclient handle — call() and
rich-client handle — call()).
1. Signature
call<T = unknown>(method: string, params?: unknown[]): Promise<T>;
-
method— the host method name (e.g.'getSelectedObjects','openIndexData', or any host method you call raw). -
params— the argument array posted with the call (default[]).
2. Per-host dispatch
| Host / state | Behavior |
|---|---|
destroyed |
Rejects immediately with |
portable method name (any host) |
Routes through the same |
unknown name, rich client |
Rejects with a descriptive |
unknown name, webclient |
Posts |
standalone (or still detecting without a wire) |
Rejects (bounded) with |
All seven portable names share the dispatch core, so the string-based call
and the typed facade are behaviorally identical when the argument shape
matches the per-method normalization. Each portable method accepts either
the positional wire array or the plain options object — both normalize to
the same wire post. For openIndexData that is the array
[inNewTab, mode, objectId, objectTypeId?] or the object
{ inNewTab, mode, objectId, objectTypeId? }.
3. Examples
// portable name — same dispatch core as the typed facade
const sel = await dashlet.call('getSelectedObjects');
// portable name, positional array form — identical to
// dashlet.openIndexData({ inNewTab: false, mode: 'view', objectId: '1024' })
const ok = await dashlet.call('openIndexData', [false, 'view', '1024']);
// non-portable name — raw webclient passthrough (any host method name not
// in the 7 portable ones posts as [method, params, { msgId }])
await dashlet.call('myOtherHostMethod', ['arg1', 'arg2']);
4. Errors
-
Error('dashlet destroyed')— the dashlet was destroyed before the call. -
TypeError— an unmapped method in the rich client, or a descriptive argument-validation error from the portable core (e.g. an invalid object id). -
TimeoutError— bounded no-reply in standalone, or a host that never answered withintimeoutMs. -
The host’s
{ error }payload — when the host reports a failure on a webclient method call.