class ViewActivity

extends AppActivity implements UIRenderable

View activity base class. Represents an application activity with content that can be rendered when activated.

Note: Nothing is rendered if the placement property is undefined (default). Make sure this property is set to a UIRenderPlacement value before rendering, or use a specific view activity class such as PageViewActivity.

See Also

PageViewActivity, DialogViewActivity.


(name?: string, path?: string): ViewActivity

.autoUpdate() static

(module: any): void

  • module — Reference to the module that should be watched for updates (build system-specific).

Register this activity class with the application auto-update handler (for automatic reload/hot module update). When possible, updates to the module trigger updates to any existing activity instances, with new methods and a new view instance.



The root component that makes up the content for this view, as a child component.



View placement mode, determines if and how view is rendered when activated.



Modal shade backdrop opacity behind content (0-1), if supported by placement mode.


(callback?: RenderCallback<Output<UIRenderable, any>>): void

Render the view for this activity and display it, if it is not currently visible.

This method is called automatically after the root view component is created and/or when an application render context is made available or emits a change event, and should not be called directly.


(): Promise<void>

Remove the view output that was rendered by ViewActivity.render, if any.

This method is called automatically after the root view component or render context is removed, and should not be called directly.


(firstFocused?: boolean): void

Request input focus on the last (or first) focused UI component, if any.

.onFocusIn() protected

(e: ComponentEvent<Component>): void

Handle FocusIn UI event, remember first/last focused component.



The UI component that was focused first, if any.



The UI component that was most recently focused, if any.


(View: UIRenderableConstructor, eventHandler?: (this: DialogViewActivity, e: ManagedEvent) => void): Promise<ViewActivity>

  • View — A view component constructor.
  • eventHandler — A function that is invoked for all events that are emitted by the view.

Create an instance of given view component, wrapped in a singleton dialog view activity, and adds it to the application to be displayed immediately. The activity responds to the CloseModal event by destroying the activity, which removes the view as well.

Returns: A promise that resolves to the view activity instance after it has been activated.

Note: Use the Application.showViewActivityAsync method, or reference an activity using a managed child property to show a view that is already encapsulated in an activity.


(message: Stringable | Stringable[], title?: Stringable, confirmButtonLabel?: Stringable, cancelButtonLabel?: Stringable): Promise<...>

  • message — The message to be displayed, or multiple message paragraphs (for arrays).
  • title — The dialog title, displayed at the top of the dialog (optional).
  • confirmButtonLabel — The label for the ‘confirm’ button.
  • cancelButtonLabel — The label for the ‘cancel’ button, if any.

Display a confirmation/alert dialog with given content. If the ‘cancel’ button label is not provided, the dialog will only contain a ‘confirm’ button. All strings are automatically translated to the current locale using the strf function.

Returns: A promise that resolves to true if the OK button was clicked, false otherwise.



Inherited from



Inherited from AppActivity.path.



Inherited from AppActivity.match.


(): AppActivity

Inherited from AppActivity.getParentActivity.


(): Application

Inherited from AppActivity.getApplication.


(match?: MatchedPath): Promise<void>

Inherited from AppActivity.activateAsync.


(): Promise<void>

Inherited from AppActivity.destroyAsync.


(): boolean

Inherited from AppActivity.isActive.



Inherited from AppActivity.activated.



Inherited from AppActivity.deactivated.



Inherited from AppComponent.renderContext.



Inherited from AppComponent.viewportContext.



Inherited from AppComponent.activationContext.

.isPresetComponent() protected

(): boolean

Inherited from Component.isPresetComponent.

.delegateEvent() protected

(e: ManagedEvent, propertyName: string): boolean | void

Inherited from Component.delegateEvent.


<TParent extends Component = Component>(ParentClass?: ComponentConstructor<TParent>): TParent

Inherited from Component.getParentComponent.


<TParent extends Component>(ParentClass?: ComponentConstructor<TParent>): TParent

Inherited from Component.getBoundParentComponent.


(name: string, inner?: ManagedEvent, context?: ManagedObject): void

Inherited from Component.emitAction.

.propagateComponentEvent() deprecated

(name: string, inner?: ManagedEvent): void

Inherited from Component.propagateComponentEvent.



Inherited from ManagedObject.managedId.



Inherited from ManagedObject.managedState.

.getReferenceCount() protected

(): number

Inherited from ManagedObject.getReferenceCount.

.getManagedReferrers() protected

(): ManagedObject[]

Inherited from ManagedObject.getManagedReferrers.

.getManagedParent() protected

<TParent extends ManagedObject = ManagedObject>(ParentClass?: ManagedObjectConstructor<TParent>): TParent

Inherited from ManagedObject.getManagedParent.


<TEvent extends ManagedEvent = ManagedEvent, TConstructorArgs extends any[] = any[]>(e: string | TEvent | (new (...args: TConstructorArgs) => TEvent), ...constructorArgs: TConstructorArgs): this

Inherited from ManagedObject.emit.


(name?: string): void

Inherited from ManagedObject.emitChange.

.propagateChildEvents() protected deprecated

(...types: ((new (...args: any[]) => ManagedEvent) | ((e: ManagedEvent) => any))[]): this

Inherited from ManagedObject.propagateChildEvents.

.activateManagedAsync() protected

(): Promise<any>

Inherited from ManagedObject.activateManagedAsync.

.deactivateManagedAsync() protected

(): Promise<void>

Inherited from ManagedObject.deactivateManagedAsync.

.destroyManagedAsync() protected

(): Promise<void>

Inherited from ManagedObject.destroyManagedAsync.

.onManagedStateActivatingAsync() protected

(): Promise<void>

Inherited from ManagedObject.onManagedStateActivatingAsync.

.onManagedStateActiveAsync() protected

(): Promise<void>

Inherited from ManagedObject.onManagedStateActiveAsync.

.onManagedStateDeactivatingAsync() protected

(): Promise<void>

Inherited from ManagedObject.onManagedStateDeactivatingAsync.

.onManagedStateInactiveAsync() protected

(): Promise<void>

Inherited from ManagedObject.onManagedStateInactiveAsync.

.onManagedStateDestroyingAsync() protected

(): Promise<void>

Inherited from ManagedObject.onManagedStateDestroyingAsync.


extends AppActivity.Presets

View activity presets type, for use with Component.with.



View placement mode.



Modal shade backdrop opacity behind content (0-1), if supported by placement mode.



Inherited from



Inherited from AppActivity.Presets.path.