onBeforeTransitionIn - Before Transition In Script

Activates JavaScript code before the transition into this Application Page control, when it is about to become visible.

Category

events

Syntax

<xp:eventHandler event="onBeforeTransitionIn" attributes>content</xp:eventHandler>

Usage

In Design mode, click All Properties and look for onBeforeTransitionIn in the events section.
Note: This event is new for Release 9.0.1

This is an event that occurs when transitioning between Application Page controls.

The sequence of transition events are triggered in a defined order. For example, say you have two Application Page controls, page1 and page2, where page1 is currently shown. When you click on a button that causes a transition to page2, these events are first triggered in this order: page1 onBeforeTransitionOut, page2 onBeforeTransitionIn - then page2 is made visible.

These events then occur in this order: page1 onAfterTransitionOut, page2 onAfterTransitionIn.

The transition in events can be used for preparing some content in the page that is becoming displayed, and the transition out events might be used for cleaning up some content that is no longer needed since the page is no longer displayed.

For example, if you had an animation that runs while a page is displayed, you might start that animation when the page is shown, and stop the animation when the page is hidden, so that it is no longer consuming resources that might make the other pages run slowly.

Examples

<xe:appPage id="allDocuments" pageName="allDocuments">
	<xp:eventHandler event="onBeforeTransitionIn"
				submit="false">
	<xe:this.script><![CDATA[console.log('onBeforeTransitionIn allDocuments');]]&gt;</xe:this.script>
	</xp:eventHandler>
</xe:appPage>