getRichClientApi()

dashlet.getRichClientApi() gives typed access to the full osjx* bridge of the rich client. The handle is synchronous (the bridge is a synchronous COM/JS call): every method returns its value or throws synchronously. Both handle accessors (getRichClientApi / getWebclientApi) are available per environment and fail hard — a missing environment is never a silent null fallback.

1. Signature

const rich: RichClientApi = dashlet.getRichClientApi();

The accessor is cached: every repeated call returns the same instance (identity via ===). The handle methods read the bridge per call (lazily) — a bridge state that is injected or swapped later becomes visible immediately, not only after a new handle.

2. Methods

Method Bridge member Behavior

getEnvironment(code)

osjxGetEnvironment(code)

Raw slot read: the string value exactly as the bridge delivers it (no trimming — the trailing space of the version in slot 10 is preserved), or null. See the slot table below.

getSelectedObjects()

osjxGetSelectedObjects

The raw selection string osid,objectTypeId;… — '' when nothing is selected (a real value, not null). For the normalized SelectedEntry[] shape there is the facade getSelectedObjects().

openDataSheet(objectId, readOnly)

osjxOpenDataSheet

Opens the data sheet of objectId read-only (readOnly = true) or editable.

openObject(objectId)

osjxOpenObject

Opens the object in its natural view.

openLocation(objectId)

osjxOpenLocation

Opens the location (preview) of the object.

openResultList(json)

osjxOpenResultList

Opens the result list; json is the raw JSON string (e.g. {"title":"…","hits":[…]}).

refreshObjectInLists(objectId)

osjxRefreshObjectInLists

Refreshes the object in open hit lists.

getBrowserEnvironment()

osjxGetBrowserEnvironment

Raw read of the browser-environment object (unknown) — null when the bridge surface lacks this member.

setBrowserCaption(caption)

osjxSetBrowserCaption

Sets the preview caption.

has(method)

— (live probe)

true exactly when the bridge member exists and is a function — probed fresh on every call (no caching).

call(method, params?)

any member

The documented escape hatch: the raw, typed bridge passthrough for uncataloged osjx* members. Synchronous, throw-safe.

3. The getEnvironment(n) slot table

Slot Meaning Note

3

user name (userName)

10

client version

Raw value: the trailing space is preserved (trimmed/normalized only in InitContext.clientVersion).

14

full name (fullName)

16

e-mail

18

user GUID

24

language (GUI short code)

'' is a real value — version 10.10 delivers empty values at start (warm-up), see below.

27

session GUID

other

not documented

The host marker "Unbekannter Parameter: N" is filtered — the method yields null instead of the marker.

null and '' are strictly distinct: null means "not readable" (absent member, a throwing call, unknown slot), '' is a real empty value. To tell apart whether the member itself is absent, use rich.has('osjxGetEnvironment'); the facade getSelectedObjects() delivers the normalized selection shape.

4. call() — the documented escape hatch

rich.call('osjxGetEnvironment', [3]) invokes any osjx* member with the argument array and returns the raw value (or undefined). A missing member throws the descriptive TypeError (see Errors); a throwing bridge call is converted into the descriptive Error. The cataloged methods (table above) are the preferred path — call is the documented fallback for uncataloged endpoints.

5. Reduced bridge and lazy reads

The detection semantics are unchanged: a reduced COM-OpenBrowser bridge (only osjxGetBrowserEnvironment + osjxSetBrowserCaption, without the dashlet marker member osjxGetSelectedObjects) is not a dashlet bridge — the environment resolves to standalone, where the accessor throws the wrong-environment error (see Errors). After a richClient resolution (full bridge at detection time), the handle reads the bridge per call; if only a reduced surface shows up at call time, that is reflected honestly: reads yield null, write methods throw the descriptive TypeError, has() returns false for the missing members, and the browser members work.

6. v10.10 warm-up (raw reads)

On client version 10.10, osjxGetEnvironment(n) delivers empty values at start until the warm-up is complete. The handle reads the bridge live — a getEnvironment(…) call before the warm-up ends therefore yields '' (the real empty value), and the value afterwards. The library itself runs its own bounded warm-up with a refresh and re-emission of the context (see environments — v10.10 warm-up).

7. Errors

  • Error('dashlet destroyed') — the dashlet was destroyed before the call (accessor and handle methods).

  • TypeError: Dashlet.getRichClientApi(): the environment is not resolved yet - await the dashlet.init promise first — the call happened before the environment was resolved.

  • TypeError: Dashlet.getRichClientApi(): the rich client API handle is only available in the richClient environment (current: …) — call in the wrong environment (the current value is named).

  • TypeError: Dashlet: the rich-client bridge does not expose "…" (bridge method missing) — write/call on a missing bridge member.

  • Error: Dashlet: rich-client bridge call "…" failed: … — the bridge call itself threw.