Interface: TargetView

jrt.TargetView

Base interface for the app's views (pages and dialogs). A view is lazily created (only once) when it is first shown. The view that is currently active (the topmost visible page or dialog) is available in jrt.App#currentView.

You can discard one or all currently created views with jrt.App#clearViewCache.

Extends

Members

(nullable) caller :jrt.Target

The target that called this target for the last time.

Type:
Inherited From:

(constant) id :string

The target id.

Type:
  • string
Inherited From:

(non-null) req :jrt.AppRequest

The request that activated this target.

Type:
Inherited From:

Methods

actionFinished(actionnon-null)

This method is called when an action that was requested from this target is finished explicitly with the jrt.Action#finish method.

This base implementation does nothing. Override as needed.

Parameters:
Name Type Description
action jrt.Action
Inherited From:

dialogClosed(dialognon-null)

This method is called when a dialog that was opened from this target is closed. A dialog is usually closed by submitting a form with the "dialog" method. It can also be closed with jrt.Modal#close or with a #back URL.

This base implementation does nothing. Override as needed.

Parameters:
Name Type Description
dialog jrt.Modal
Inherited From:

hidden()

This method is called when a view is hidden. If the view being hidden is a page, this is called before the jrt.Page#requested method of the page to be shown.

requested()

This method is called when this target is requested. The request object can be found in the req property.

If this is a view, this method is called before the jrt.TargetView#shown method. You may cancel the request (thus preventing the view from showing) by calling jrt.App#navigateBack from this method. If this is a dialog, you can also do this by calling jrt.Dialog#close. The request can also be cancelled in this way from jrt.App#pageRequested and jrt.App#dialogRequested.

If this is a page, you can redirect the request by calling jrt.App#navigateTo from this method (you can also do this from jrt.App#pageRequested).

This base implementation does nothing.

Inherited From:

shown()

This method is called when a view has just been made visible, after a request to this target. The request object can be found in the req property. Note that this method will not be called when a view is reloaded.