top.js
This is the set of "free" functions available in top.js, which is included by cis.jsp. You typically access these functions using the top.xyz() syntax, assuming your code is running in an iframe nested under cis.jsp.
The trend has been to de-emphasize the use of functions at this level, and migrate them to the main level. In the future we plan to eliminate the distinction between the top and main frames.
• getNavigationKeyForService(service)
Answers the navigation key corresponding to the given service (string). Since there may be several nav keys for the same service, the last one is answered. You always get the correct response for tab menus.
• getURL(navigationKey, withoutLanguage)
Answer the URL (string) corresponding to the given navigation key (also a string). If the withoutLanguage boolean is false, the user's language code is appended to the URL as a GET parameter.
• getFieldLevelSecurityInfo(navigationKeyOrService)
Answer the field-level security meta-data for the tab menu given by the navigation key or service. The result takes the form of a simple JavaScript object, with security types as properties, and values as arrays of all related authentication levels. For example, assume that adjustment maintenance has field-level security defined for a user for security type "ADJAMT", with two associated authentication levels, "1", and "3". To retrieve the object defining all field-level security info for the service:
var info = top.getFieldLevelSecurityInfo('adjustmentMaint')
or
var info = top.getFieldLevelSecurityInfo('CILAADUP')
(Note the literal JavaScript representation of the result object would be {ADJAMT: ['1', '3']})
To determine the array of authentication levels associated with this service and security type in one step:
var authenticationLevels = top.getFieldLevelSecurityInfo('adjustmentMaint')['ADJAMT']
or
var authenticationLevels = top.getFieldLevelSecurityInfo('CILAADUP')['ADJAMT']
• getMain()
This heavily used function returns a reference to the window constituting the "main" iframe, containining cisMain.jsp and the core model. The typical usage is top.getMain(), but many iframes define a global variable "main" for convenience.
• tabMenu()
This function returns a reference to the current tabMenu iframe window. The typical usage is top.tabMenu(). Many iframes define a global variable "topMenu" for convenience.
• tabPage()
This function returns a reference to the current tabPage iframe window. The typical usage is top.tabPage(). Many iframes define a global variable "topPage" for convenience.
• model()
This convenience accessor method returns a reference to the core model held in the "main" frame.
• openPage(navigationKey, tabName, keys, extraPageState, keepMemento, forceOpen)
This is a convenience function for the same function defined in cis.js. See the description there for a fuller description.
• getUser()
Returns the user id of the current user.
• getUser()
Returns the user id of the current user.
• getLanguage()
Returns the language code of the current user.
Parent topic