You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/workspace/developers/json-specs/widgets-json-reference.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -320,6 +320,11 @@ A `Widgets.json` table is a configuration structure with any of the named attrib
320
320
_Example:_`"id"`
321
321
_Example use case:_ If your table displays company names in the cell but your API expects company IDs, set `valueField: "companyId"` to use the ID field from the row data instead of the displayed name.
322
322
323
+
-**forceUpdate**
324
+
_Type:_`boolean` (optional)
325
+
By default, clicking a cell updates the shared parameter for the other widgets in the group, but the widget containing the clicked cell does not re-fetch its own data. Set this to `true` to force the source widget to update as well when one of its cells is clicked.
326
+
_Example:_`true`
327
+
323
328
-**colorValueKey**
324
329
_Type:_`string`
325
330
Specifies which field to use for determining the color when showing cell changes.
Copy file name to clipboardExpand all lines: content/workspace/developers/widget-configuration/render-functions.md
+26Lines changed: 26 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -235,6 +235,32 @@ In this example:
235
235
]
236
236
```
237
237
238
+
### Using forceUpdate to Refresh the Source Widget
239
+
240
+
By default, when a cell click updates a parameter through the `groupBy` action, only the other widgets that share the parameter are refreshed — the widget containing the clicked cell does not re-fetch its own data. If the source widget also uses the parameter (for example, the table filters or highlights rows based on the selected symbol), set `forceUpdate: true` so it updates too:
241
+
242
+
```json
243
+
{
244
+
...
245
+
"columnsDefs": [
246
+
{
247
+
"field": "symbol",
248
+
"headerName": "Symbol",
249
+
"renderFn": "cellOnClick",
250
+
"renderFnParams": {
251
+
"actionType": "groupBy",
252
+
"groupBy": {
253
+
"paramName": "symbol",
254
+
"forceUpdate": true
255
+
}
256
+
}
257
+
}
258
+
]
259
+
}
260
+
```
261
+
262
+
With `forceUpdate: true`, clicking a symbol cell updates the `symbol` parameter and re-fetches the table widget's own data in addition to updating the other widgets in the group.
263
+
238
264
### Hover Card
239
265
240
266
To use the hover card render function, you need to add it to the `columnsDefs` array in your `widgets.json` file for the column you want to apply it to.
Copy file name to clipboardExpand all lines: content/workspace/developers/widget-parameters/cell-click-grouping.md
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -229,3 +229,31 @@ In this example:
229
229
- When displaying human-readable text but needing to pass IDs or codes
230
230
- When the displayed value differs from the parameter value format
231
231
- When you want to decouple the display value from the API parameter value
232
+
233
+
## Using forceUpdate to Refresh the Source Widget
234
+
235
+
By default, clicking a cell only updates the other widgets that share the parameter — the table widget containing the clicked cell does not re-fetch its own data. This avoids unnecessary requests, since the table usually just provides the selection.
236
+
237
+
If the table widget itself also depends on the parameter (for example, it filters or highlights its rows based on the selected symbol), set `forceUpdate: True` in the `groupBy` configuration so the source widget re-fetches its data as well:
238
+
239
+
```python
240
+
{
241
+
"field": "symbol",
242
+
"headerName": "Symbol",
243
+
"cellDataType": "text",
244
+
"width": 120,
245
+
"renderFn": "cellOnClick",
246
+
"renderFnParams": {
247
+
"actionType": "groupBy",
248
+
"groupBy": {
249
+
"paramName": "symbol",
250
+
"forceUpdate": True# Also re-fetch this widget's data on click
251
+
}
252
+
}
253
+
}
254
+
```
255
+
256
+
**When to use forceUpdate:**
257
+
258
+
- When the table widget's own endpoint uses the parameter being updated
259
+
- When clicking a cell should refresh the data shown in the source table, not just the connected widgets
Copy file name to clipboardExpand all lines: content/workspace/developers/widget-types/iframe.md
+47Lines changed: 47 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,8 @@ keywords:
8
8
- streamlit
9
9
- embed external app
10
10
- postMessage
11
+
- openbb-auth
12
+
- auth headers
11
13
- mcpUrl
12
14
- destructiveHint
13
15
- sub-widgets
@@ -24,6 +26,7 @@ On its own, an iframe just renders the URL. But by implementing the **Iframe Wid
24
26
25
27
-**Export sub-widgets** — declare tables and markdown sections inside the iframe that Workspace can pull out as standalone dashboard widgets.
26
28
-**Receive toolbar parameters** — react to Workspace parameters (dropdowns, dates, toggles) without a backend round-trip.
29
+
-**Receive auth headers** — get the auth headers configured on the widget's backend connection, so the app can make authenticated API calls without re-prompting for credentials.
27
30
-**Auto-connect an MCP server** — wire up Copilot tools the moment the widget mounts.
28
31
-**Auto-refresh on mutating tool calls** — remount the iframe after a destructive MCP tool runs so the UI reflects new state.
29
32
@@ -92,6 +95,7 @@ The protocol is a small set of `postMessage` events exchanged between the embedd
92
95
93
96
-**`openbb-request`** — Workspace asks the iframe for a sub-widget's data. A `widgetId` of `null` means "send everything."
94
97
-**`openbb-params-update`** — Workspace pushes new toolbar parameter values to the iframe (e.g. the user changed a dropdown). The app reads these and re-renders.
98
+
-**`openbb-auth`** — Workspace sends the widget's configured auth headers to the iframe in response to `openbb-connect`. See [Receiving auth headers](#receiving-auth-headers-openbb-auth).
95
99
96
100
### Sub-widget manifests
97
101
@@ -188,6 +192,49 @@ The bridge below is the complete client side of the protocol — announce on loa
188
192
})();
189
193
```
190
194
195
+
## Receiving auth headers (`openbb-auth`)
196
+
197
+
If the widget's backend connection was configured with auth headers (for example an `Authorization` or `X-API-KEY` header entered when the backend was added to Workspace), Workspace forwards those headers to the embedded app so it can make authenticated requests of its own — for instance, calling the same backend the widget belongs to.
198
+
199
+
The flow is part of the handshake:
200
+
201
+
1. The embedded app sends `openbb-connect` (as in the [Minimal bridge](#minimal-bridge) above).
202
+
2. Workspace replies with an `openbb-auth` message containing the configured headers:
Because `openbb-auth` is only sent in reply to `openbb-connect`, register your `message` listener before (or at the same time as) sending the handshake, or the reply may arrive before you are listening.
228
+
229
+
### Security constraints
230
+
231
+
Workspace only sends `openbb-auth` when **both** of these hold:
232
+
233
+
- The backend connection actually has headers configured — if there are none, no message is sent.
234
+
- The `openbb-connect` message's origin **exactly matches** the origin of the iframe's `src` URL. The reply is posted targeted at that origin (never `"*"`), so credentials cannot leak to a different origin.
235
+
236
+
The origin check means pages that send the handshake from a nested sub-frame on a *different* origin than the widget's `endpoint` URL (some component-based frameworks do this) will not receive the headers — send `openbb-connect` from the top-level page of your app in that case.
237
+
191
238
## Pushing parameters back to Workspace
192
239
193
240
The protocol messages above cover the **inbound** direction — Workspace pushing parameter values *into* the iframe with `openbb-params-update`. The parameter bridge is the **outbound** direction: a widget pushes a new parameter value *back to* Workspace. Workspace persists the update and re-sends it to every widget [grouped](../json-specs/apps-json-reference) on that parameter, so one widget can drive the rest of the dashboard.
0 commit comments