2.0

 Overview

This document provides an overview of the changes made for Reference Framework 2.0.

Requirements

Reference Framework 2.0 runs against Nexaweb Platform 4.5.33 or higher.  

Updates to security roles

Security roles have always been a part of the reference framework.   In 2.0, where roles can be used has been expanded on the page, command bar and menu, as well as components within the page.  

Command Bar and Menu Bar Roles

Buttons and menu items can be made to be visible or enabled through the use of the roles by setting the role attribute of the button or the menu item in the nexaweb-reference-framework.xml.

Role Attributes

  • roleVisible - specifies the role(s) required for the button/menu item to be visible
  • roleEnabled - specifies the role(s) required for the button/menu item to be enabled

Page Roles
Through the use of roles a page can be used to control whether or not a page can be opened, or open the page as read-only.

Role Attributes

  • roleOpen - specifies the role(s) valid for opening the page
  • roleReadOnly - specifies the role(s) that will open the page as read-only

Component Roles
Role attributes on components can be used to control whether or not a control is visible, enabled, or read-only.

Role Attributes

  • roleEnabled - specifies the role(s) required to make a component enabled
  • roleVisibile - specifies the role(s) required to make a component visible
  • roleReadOnly - specifies the role(s) required to make a component read only 

Page Events

Page events have been added to the reference framework. These events allow control over the lifecycle of the page, as well as navigation to and from a page.

onPageLoaded
The onPageLoaded event is fired once when a page is loaded. This provides a means for initializing any code associated with the page.

onPageActivated
The onPageActivated event is fired when a page gains focus. This event provides a mechanism for initialize a page when gaining focus from another tab.

onPageDeactivated
The onPageDeactivated event is fired when a page is loses focus. This provides a hook for validating a page during page navigation.  Returning false from the onPageDeactivated event handler will prevent the page from losing focus.

onBeforePageClosed
The onBeforePageClosed event is fired before the page is closed. This provides a hook for one time validation and processing before the page is closed.  Returning false from the onBeforePageClosed event handler will prevent the page from closing.

onPageClosed
The onPageClose event is fired once when a page is closed. This provides a means for cleaning up any code associated with the page.

Page Navigation

Navigation methods have been added to the PageManager interface. Page navigation methods have been added to allow navigation to the next or previous page as well as back to the homepage. Tab navigation methods have been added to allow navigation to the next or previous open page while in tab mode.

Page Attributes
New attributes nextPage and prevPage are defined on the page.  These attributes are used by the nextPage() and prevPage() methods of the PageManager to navigate from one page to the next.

Example Configuration

 

<page name="homePage" xal="HomePage.xal" title="Home Page" nextPage="firstPage"/>
<page name="firstPage" xal="FirstPage.xal" title="First Page" prevPage="homePage" nextPage="secondPage"/>
<page name="secondPage" xal="SecondPage.xal" title="Second Page" prevPage="firstPage" nextPage="thirdPage"/>
<page name="thirdPage" xal="ThirdPage.xal" title="Third Page" prevPage="secondPage"/>

 

Page Manger methods homePage() –  Opens the home page configured for the logged in user. If the home page is already open, it will become the active page.

nextPage() – Opens the page configured as the nextPage for the active page. If the next page is already open, it will become the active page.

prevPage() – Opens the page configured as the prevPage for the active page. If the next page is already open, it will become the active page.

nextTab() – Sets the page in the next tab to be the active page. If the active page is the last tab, this method performs no operation. This method only works when the pageStyle is configured to tabs.

prevTab() – Sets the page in the previous tab to be the active page. If the active page is the last tab, this method performs no operation. This method only works when the pageStyle is configured to tabs.

shortcut Focus

The shortcutFocus property defines a key chord that will set focus to a component. If the component being focused is contained within a tab that is not visible, then the tab will be selected. Configuring shortcutFocus on a tab, simply selects the tab.   

Dialog Management

A new class has been added to the reference framework for managing modal and modeless dialogs.  Pages can now be opened as modeless (pop-ups), or modal dialogs regardless of the page style being used.

The DialogManager class is registered as a system container, so it can be referenced within onCommand definitions.  For example, onCommand=”DialogManager.showModalDialog( ‘myDialogPage’ )”.

XAL Caching

Caching of XAL files used by the pages has been added to the reference framework.  A new section has been added to the nexaweb-reference-framework.xml to allow for the configuration of the cache. 

<cache>
 <xalCache cacheSize="10"/>
</cache>

Currently only the size of the cache can be configured.   If the cache reaches maximum capacity, the least recently opened (or focused) page will be removed from the cache.

Page Container renamed

The container that holds the page definitions from the nexaweb-reference-framework.xml file has been renamed to pageDef.    While this should be a relatively transparent change, if the page container was referenced then these references will have to be changed.

For example,
If the page was references in the nexaweb-reference-framework.xml toload the page

    page:myPage.load()

The page would now need to be referenced as follows.

    pageDef:myPage.load()