The currently active view controller (dialog, drawer, popover, embed, etc.); used to access view-level info and actions. Provided by FlowViewContext; only available inside content opened via ctx.viewer or ctx.openView.
| Scenario | Description |
|---|---|
| Dialog/drawer content | In content, use ctx.view.close() to close, or render Header, Footer for title and actions |
| After form submit | Call ctx.view.close(result) to close and pass result back |
| JSBlock / Action | Check ctx.view.type for view type, or read ctx.view.inputArgs for open params |
| Association select, sub-table | Read inputArgs for collectionName, filterByTk, parentId, etc. for loading data |
Note:
ctx.viewis only available in RunJS when a view context exists (e.g. insidectx.viewer.dialog()content, dialog form, association selector); in a normal page or backend context it isundefined—use optional chaining:ctx.view?.close?.().
| Property/Method | Type | Description |
|---|---|---|
type | 'drawer' | 'popover' | 'dialog' | 'embed' | Current view type |
inputArgs | Record<string, any> | Params passed when opening the view |
Header | React.FC | null | Header component for title and actions |
Footer | React.FC | null | Footer for buttons, etc. |
close(result?, force?) | void | Close current view; optional result passed back to caller |
update(newConfig) | void | Update view config (e.g. width, title) |
navigation | ViewNavigation | undefined | In-view navigation (tabs, etc.) |
Currently only
dialoganddrawersupportHeaderandFooter.
Fields in inputArgs depend on how the view was opened; common ones:
| Field | Description |
|---|---|
viewUid | View UID |
collectionName | Collection name |
filterByTk | Primary key filter (single record) |
parentId | Parent id (associations) |
sourceId | Source record id |
parentItem | Parent item data |
scene | Scene (e.g. create, edit, select) |
onChange | Callback after select/change |
tabUid | Current tab UID (in-page) |
Access via ctx.getVar('ctx.view.inputArgs.xxx') or ctx.view.inputArgs.xxx.
| Use | Recommended |
|---|---|
| Open new view | ctx.viewer.dialog() / ctx.viewer.drawer() or ctx.openView() |
| Operate current view | ctx.view.close(), ctx.view.update() |
| Open params | ctx.view.inputArgs |
ctx.viewer opens views; ctx.view is the current view instance; ctx.openView opens configured flow views.
ctx.view is only available inside a view; on a normal page it is undefined.ctx.view?.close?.() to avoid errors when no view context.close(result) passes result to the Promise returned by ctx.viewer.open().
ctx.viewerprovidesdialog(),drawer(),popover(),embed(); inside theircontentyou can usectx.view.