Screen
For each Screen, Lowgile generates a Screen definition. You reach it as This.$Screens.<ScreenName> to build the Screen’s URL, open it as a dialog, or pass it to Sys.Screen functions such as navigateToScreen().
Availability: Everywhere
How to reach it
Section titled “How to reach it”This.$Screens.<ScreenName> is the Screen definition. Screens are grouped under the $Screens namespace: This.<ScreenName> does not work.
A Screen definition has the type ScreenDefinition<P, I, O>, built from the Screen’s variables:
P: the path parameters, the Screen variables that are passed in the URL.I: the inputs, the Screen variables passed when the Screen is opened from code.O: the Screen’s outputs, by name.
This.$Screens exists on both sides. On the server, the Screen itself can’t be shown: component is undefined and openAsDialog() throws an error.
Functions
Section titled “Functions”getFullUrl()
Section titled “getFullUrl()”getFullUrl(params: P): stringReturns the absolute URL that opens the Screen, with params as URL query parameters. The URL starts with the instance’s public URL (System.$Config.Environment.publicUrl). A Screen of another Module is addressed by its qualified name <ModuleId>.<ScreenName>.
| Parameter | Type | Description |
|---|---|---|
params | P | Values for the Screen’s path parameters. Pass {} if it has none. Parameters whose value is undefined or null are left out. |
Returns: string · Availability: Everywhere
openAsDialog()
Section titled “openAsDialog()”openAsDialog<X extends keyof O>(inputData: P & I, outputName: X, options?: ScreenDialogOptions): Promise<O[X]>Opens the Screen in a dialog and waits until it closes. The dialog closes when the Screen emits the output outputName, and the returned promise resolves with that output’s value.
| Parameter | Type | Description |
|---|---|---|
inputData | P & I | Values for the Screen’s path parameters and inputs. |
outputName | X | The output that closes the dialog and whose value is returned. |
options | ScreenDialogOptions | Optional. Size, position and behaviour of the dialog. |
ScreenDialogOptions fields
| Field | Type | Required | Description |
|---|---|---|---|
disableClose | boolean | Optional | If true, the End user can’t close the dialog with the Escape key or by clicking outside it. |
hasBackdrop | boolean | Optional | Whether a backdrop covers the page behind the dialog. |
height | string | Optional | The dialog’s height, as a CSS value such as '400px'. |
width | string | Optional | The dialog’s width, as a CSS value. |
maxHeight | string | number | Optional | The maximum height. A number is in pixels. |
minHeight | string | number | Optional | The minimum height. A number is in pixels. |
maxWidth | string | number | Optional | The maximum width. A number is in pixels. |
minWidth | string | number | Optional | The minimum width. A number is in pixels. |
panelClass | string | string[] | Optional | CSS classes to add to the dialog’s container. |
position | { top?: string; bottom?: string; left?: string; right?: string } | Optional | The dialog’s position on the page, as CSS values. |
const confirmed = await This.$Screens.ConfirmOrder.openAsDialog({ orderId: order.id }, 'confirmed', { width: '600px' })Returns: Promise<O[X]> · Availability: Client
Note
If the End user closes the dialog without the Screen emitting outputName, for example with the Escape key, the promise resolves with undefined.
Properties
Section titled “Properties”moduleId
Section titled “moduleId”moduleId: stringThe ID of the Module the Screen belongs to.
Type: string · Availability: Everywhere
boId: stringThe Screen’s name.
Type: string · Availability: Everywhere
component
Section titled “component”component: ClassThe Angular component class that renders the Screen.
Type: Class · Availability: Client
Note
On the server, component is undefined, although it is declared in server-side code too.
ScreenDefinition
Section titled “ScreenDefinition”interface ScreenDefinition<P, I, O extends Record<string, any> = Record<string, any>> { moduleId: string boId: string component: Class getFullUrl(params: P): string openAsDialog<X extends keyof O>(inputData: P & I, outputName: X, options?: ScreenDialogOptions): Promise<O[X]>}The type of every entry of This.$Screens. Sys.Screen functions take a ScreenDefinition as their Screen parameter.
Availability: Everywhere
Related
Section titled “Related”- Sys.Screen
- Screens
- Screen variables