has(method)
rich.has(method) is the live capability probe of the rich-client
handle: it checks whether the bridge (window.osClient) currently
exposes the member method as a function. It is a method of the
rich-client handle — the handle is
obtained once via dashlet.getRichClientApi(); has() probes the
bridge on every call (live, no cache).
2. Parameters
| Name | Type | Description |
|---|---|---|
|
|
The name of the bridge member (e.g. |
3. Behavior
has() is synchronous and returns true exactly when the
bridge member exists and is a function — the exact
probeFunction semantics. All other states yield false:
| Bridge state | Result | Note |
|---|---|---|
|
|
|
|
|
|
The read of |
|
Both host behaviors — throwing reads and silent
|
|
|
No cache. Every call probes the current bridge state —
window.osClient is read per call, without a snapshot. A bridge
surface swapped in or reduced later becomes visible immediately: a
member injected later yields true from then on, a removed one
false.
Never an error for the bridge state. A missing, non-functional
or exception-throwing member yields false — not an error.
Reduced bridge. The reduced COM-OpenBrowser bridge carries only
osjxGetBrowserEnvironment + osjxSetBrowserCaption (without the
dashlet marker member osjxGetSelectedObjects); there therefore:
rich.has('osjxGetSelectedObjects') → false and
rich.has('osjxGetBrowserEnvironment') → true.
Pattern. has('osjxGetEnvironment') distinguishes a missing
member from an unknown slot for
getEnvironment(code): an
unknown slot (the member exists, the code is unknown) yields
null, while has() stays true; a missing member makes
has() yield false.
5. Errors
has() throws for no bridge state — a non-readable or
exception-throwing member yields false instead of an error. The
only hard errors are:
-
Error('dashlet destroyed')— the dashlet was destroyed (guard of every handle method, includinghas()). -
TypeError: Dashlet.getRichClientApi(): the environment is not resolved yet - await the dashlet.init promise first— the accessor was called before the environment was resolved. -
TypeError: Dashlet.getRichClientApi(): the rich client API handle is only available in the richClient environment (current: …)— the accessor was called in the wrong environment (the current value is named).