Session State APIs in JET or JavaScript Pages (Release 9.2.5.4)

Note: You must be aware that browser session storage has size limits and potential impact on the performance. Storing a large amount of data in the browser session storage might result in higher browser memory consumption and the high frequency of storage calls can impede the application's performance. It is important to be aware of these limitations when you determine what to store and how often to access the stored data.

Starting with Tools Release 9.2.5.4, the jetUtilities.js file provides APIs that can be used to save the session state in an EnterpriseOne JavaScript page. The jetUtilities.js file is used in the UX One JavaScript pages and can be used in all EnterpriseOne JavaScript pages.

You can use the session state utilities by leveraging the browser session storage along with the existing external form framework to maintain state in the JavaScript pages. With this capability, when a user navigates away from the page or launches another EnterpriseOne application and then returns to that page, the system restores the state as it was before the user left the page.

Each session state management method depends on a unique key that identifies the stored object based on the instance of the external form and the E1PAGE ID. This key is designed so that the page is uniquely identifiable in all scenarios such as execution of an action from the Fast Path, on the Welcome pages, within a composite page, or on a CafeOne layout. The key is determined by the APIs in the jetUtilities.js file.

The state for the page is always stored as a JSON string and the utility methods always attempt to manage the state as an object. Therefore, you need to reference only the state object (and not the string).

The following table describes the four new helper methods used to store the session state:

Function Parameters Value Returned Description
jde__restoreState() None State Object Returns the object for this page instance if a state is already stored. If no state is stored, null is returned.
jde__clearState() None None Clears the stored state for this page instance.
jde__saveState(state) State Object None Saves the object passed in session storage for this page instance.
jde__manageState(state) State Object None Makes the required call in document ready function to manage the state.