prepareForTransition()

Description:

The widget's view is composed by HTML elements such as text display area, buttons, edit fields, and so on. The appearance of these HTML elements can be dynamically changed. For example, they can be shown or hidden dynamically using the HTML DOM style object to set the display property to "block" or "none" respectively. For instance:

To show an element, call [object].style.display = "block"

To hide an element, call [object].style.display = "none"

The purpose of the prepareForTransition method is to prepare a widget for a transition state before modifying the widget view by disabling updates to the widget UI. Thus, when modifying a widget view where the appearance of many HTML elements will be changed, prepareForTransition will help to prevent the widget UI from being updated at once and one by one, which could potentially cause screen flickering.

Syntax:

[void] widget.prepareForTransition(String transitionMode) 

or

[void] window.widget.prepareForTransition(String transitionMode)

Arguments:

  • transitionMode:

    A text string defining a desired transition mode. Currently the only supported transition mode is "fade", which causes the widget's view changing in fading mode.

Return value:

This method does not return a value.

Remarks:

This method is to be used together with the performTransition method. A widget's screen is not updated until the performTransition method is called.

Example code:

See the performTransition example code.