Form → Job → one refreshed tile
This example has two cells: a form and a recent-jobs tile. Submit commits the form, starts a Job, polls that exact Job and refreshes onlyjobResult. The form remains mounted with its values.
Prepare an active Job template that accepts a batch input. Its worker reads that value from api.input().templateInputs.batch. Prepare two Components with a visible element named Data: one starts the Job, the other reads its status. The examples below supply their bodies.
1. Configure the widget
Choose Inline code, JavaScript, and set Inputs to:{ matrix } or { rows }. This applies to root views, drill targets and partial refreshes in both chat and dashboards. Action receipts are separate objects and are not view output.
These JSON maps are properties of the widget configuration, not cells in its returned matrix. Configured inputs is JSON text in both source modes. The widget parses it once, so api.input() receives the object. Action bindings override target defaults; a completion probe receives its own configured inputs and waitFor.input mappings. You can pin a target’s Component digest when a reviewed revision must remain fixed.
2. Return the form and result tile
Paste this into the widget’s Inline code:jobId returned by this submission.
On a partial refresh, return exactly the requested IDs. Check targetIds before expensive queries: refreshing one rendered cell still executes the source body, so the source decides which work to skip.
3. Start the Job in the write Component
Use this body in the starting Component’sData element. It validates the input and records a bounded duplicate-dispatch guard before enqueueing:
requestId; do not automatically enqueue another one. A deliberate new submit has a new dispatch ID. Enforce business idempotency in the worker for operations that must occur only once.
4. Read the exact Job in the status Component
Jobs list reads use a restricted projection. Query the confirmed jobId with fields: ['jobId', 'status']; output and inputs are not supported list fields. Show the confirmed status or fetch results from a separately verified business resource. Test the result branch with an existing authorized job before publishing.
The submit control and its form inputs stay locked while the action runs, while confirmation is pending, and through the configured cooldown. A successful enqueue is not completion. A terminal failure releases the lock with an error; a timeout or network failure leaves the outcome uncertain and never replays the write automatically. When a receipt is available, the button can check status again. A cooldown is a client-side throttle, not a durable server lock or lease.
Reads in this example and all status probes are read-only. Keep reusable view Components in restricted mode: an initial Component render without configured target maps retains its existing restricted-mode setting, even if its result later introduces interactive controls. Configured target maps and subsequent interactive refreshes force read-only execution. Writes through an action require explicit readOnly: false on the registered action target and the caller’s normal execution permissions. The UI does not grant access; validate business inputs and authorization in the write path.
Continue with reactive widgets.
