The frames must enforce task-based and user-based navigation, and organize screen real estate more effectively by collating tasks, providing dedicated spaces for primary-task supporting information, and maintain general order and appropriate hierarchy among various elements on the screen.
The benefits to the end-user are primarily around standardization of look and feel which will provide consistency, predicability and ease of use. The engineering benefits are that this will enforce a reusable system of components that fulfill common layout and navigational requirements in a structured, consistent manner.
For a sample of reusable frames designed for different contexts (contentscript, popup, mobile, desktop, etc.) refer to components under the /frame repository. For illustration purposes, we will provide details on the elements for the stickydock frame.
navable pieces (via. frame_setnav)
navable pieces (via. frame_setnav)
navable pieces (via. frame_setnav)
permanent pieces (via. frame_setkey)
At the application root, the navmulti is created, which will define the root frame.
var modnav = modtask.ldmod('ui/w/shell/navmulti/multi');
modnav.setup(modtask);// Optional
modnav.enableUrlMode();// This is not related to NAV. It will just allow the application root to define customized TCs (frame_getnode, etc.)
modtask.modcontroller.registerCtrl(modtask);'framesetnav', 'frameaddnav', 'framenavretry', 'framenavigateback', 'frame_navigate'
'framegetparams', 'frame_getview'
'framesetkey', 'framegetkey'
['frameregister', partmodtask]
The framework uses inversion of control; The frame will need to define two sequences that it will get called on:
modtask.seqs.onsetnav
is called in response to setnav. Must reconfigure the ui navigational elements, and navigate to the appropriate UI element per modtask.modnav.
modtask.seqs.onnavigate
is called in response to navigation requests (url changes, frame_navigate, etc.). The frame will typically redraw the views based on the information provided by:
modtask.modnav.getViewFor(viewname)
It is important to seperate the registration of the frame from the definition of the UI and navigational elements and also be able to redefine the navigational items over and over throughout the frame lifecycle. A common use case is when the session status changes (login, logout, etc.) where the feature groups that are accessible should be restricted/allowed depending on the identity of the user. When the navitems are ready, the following command gets used:
['framesetnav', navitems, optionalframe]
Where
var navitems = [{
path: 'credential',views: {
'body': modtask.ldmod("kernel\\path").rel("credential/list")}
}, ...The frame_setnav command can either come directly from the frame or anywhere in the system.
To create full link URL (i.e. for links):
['framegetparams', modtask]
frame_getview should be used for this purpose:
['frame_getview', 'body', modtask]
A typical implementation, like a save button on a header, will interact like this:
var getquery = {
"action": "get","newobj": {},
"success": false,"reason": ""
}push([
['frame_blur'],['frame_getview', 'body', modtask],
function(push) {push(["query", modtask.body, getquery, modtask, ""]);
},function(push) {
if (getquery.success == false) {return push(modtask.seqs.fail('form -- ' + getquery.reason));
}