Class idx.app.ConsoleLoaderMixin
Class supporting dynamic load of UI content.
Handles all the UI registry processing and loading into the
actual templated UI widget.
Dynamic content can be loaded into specified UI elements, such as:
stack containers, tab containers, or even low level items like menus.
Loads UI from JSON registry, with following fields:
Required:
- containerId: Identifies the id of this items parent UI element. For "tab" type items, this id would be a content pane in a Dojo tab container. For "menuitem" it is the id of the containing/parent "menu". In general, a containerId is always the id of the parent item. Note, that for items of type "context" and "tab", a default containerId will be assigned if none provided. This default is the top level context switcher for the application.
- href: URL to UI content html page. The common console application framework uses this href as the content source to load into the widget ContentPane. Note: cross domain (server) loading of URLs must make use of the AjaxProxy or cross domain errors will occur.
- id: Used to uniquely identify this UI component. Note: must be unique in this application! This is the id that is used for the Dojo ContentPane widget that will wrap the UI component described by this entry in the registry. Communication from anywhere in the application, to this content pane can be done using this "id". For example, a Data Stage component with an id of "iis_ds" could access the wrapping ContentPane via the following statement: var pane = dijit.byId("iis_ds");
- name: Name for UI component item such as a tab or menu item that is NLS translated. Defaults to value of "id".
- type: Classification for type of UI element. Currently defined values are:
- context: Loads this UI item as a context switched tab container
- tab: Loads this UI item as a content pane "tab", in a contextual tab container
- menu: Loads this UI item as a menu item.
- cssclass: Style to apply to this widget
- dijt: Used instead of an href to load a remote widget vs html page. Widget loaded as content in an enclosing ContentPane. Usually use in conjunction with modulePaths.
- dojoType: Name of widget to represent this entry in the console. The default for entries with type "context" is dijit.layout.TabContainer. The default for entries with type "tab" is "dojox.layout.ContentPane". Users can override with their own widgets as long as the type is compatible with the defaults. Note that if this widget has not been loaded via a "dojo.require" it will automatically be performed before loading.
- nls: NLS message path and file
- iframe: Identifies component is wrapped in an iFrame. Currently not supported defaults to false.
- modulePaths: Sets a location for resolution of relative references (custom widgets, images, css, html, etc). All relative references to widgets, css, images, html etc in a Dojo application are relative to the location that Dojo loaded from. Because the Dojo runtime loaded from a different web application, UIs will find they need to use the Dojo "modulePath" to set the path for relative references to their own web application.
- requires: Dojo classes needed for loading UI item. Causes a dojo.require to be performed for each item specified.
- selected: Selects this item when shown
- style: Element style to apply to this widget
- version: Version of this component. Defaults to "1.0".
Defined in: <idx\app\_ConsoleLoaderMixin.js>.
Constructor Summary
Constructor Attributes | Constructor Name and Description |
---|---|
Field Summary
Field Attributes | Field Name and Description |
---|---|
<constant> |
Constant type for top app level 'context' container id
|
URL indicating where to load registry from.
|
|
Number of context switch areas created
|
|
<constant> |
Constant type for top app level 'tab' container id
|
Determines if the url hash will be monitored and UI selection/visibility state updated
accordingly.
|
Method Summary
Method Attributes | Method Name and Description |
---|---|
addContext(item)
Dynamically adds as a child, a dijit.layout.TabContainer
to the stack container context specified in "containerId".
|
|
addTab(item)
Dynamically adds a content pane to the specified tab pane
Creates a small 'context' object in that Dojo content pane.
|
|
constructor(args)
Default constructor
|
|
Called to process UI registry data loaded into singleton
instance registry's 'data' field.
|
Field Detail
<constant> {String} CONTAINER_ID_TOP
Constant type for top app level 'context' container id
- Default Value:
- "_ctxMain" use as: "${id}_ctxMain"
{String} href
URL indicating where to load registry from.
- Default Value:
- null
{int} numCtx
Number of context switch areas created
- Default Value:
- 0
<constant> {String} TAB_ID_TOP
Constant type for top app level 'tab' container id
- Default Value:
- "_tabMain" use as: "{id}_tabMain"
{boolean} useHash
Determines if the url hash will be monitored and UI selection/visibility state updated
accordingly. See idx.app._HashHandlerMixin for more information.
- Default Value:
- true
Method Detail
addContext(item)
Dynamically adds as a child, a dijit.layout.TabContainer
to the stack container context specified in "containerId".
Note: If no containerId is specified, the top context
container of the application will be used.
- Parameters:
- {Object} item
- - contents of workspace tabcontainer Subscribes to focus gained and lost events so that the event/alert receiver for the console can be aware of major focus changes. returns {TabContainer} new tab container
{ContentPane} addTab(item)
Dynamically adds a content pane to the specified tab pane
Creates a small 'context' object in that Dojo content pane.
- Parameters:
- {Object} item
- - contents of workspace tab
- Returns:
- {ContentPane} new tab
constructor(args)
Default constructor
- Parameters:
- {Object} args
loadUIFromRegistry()
Called to process UI registry data loaded into singleton
instance registry's 'data' field.
Calls '_loadContext' and '_loadTabs' methods.