Class idx.layout.ContentPane
Extends
dijit.layout.ContentPane.
ContentPane enabling lazy instantiation of child widget as well as asynchronous
module dependency for href'd content with embedded JavaScript and "require" calls.
Defined in: <idx\layout\ContentPane.js>.
Constructor Summary
Constructor Attributes | Constructor Name and Description |
---|---|
Field Summary
Field Attributes | Field Name and Description |
---|---|
Parameters for the single child widget.
|
|
Single child widget class.
|
|
Flag indicating if the label should be inferred from the title in some cases.
|
|
The label to use for accessibility purposes.
|
|
Default "scriptHasHooks" to true.
|
Method Summary
Method Attributes | Method Name and Description |
---|---|
Sets up CSS class.
|
|
This funtion is essentially copied from dojo.html._ContentSetter's onEnd() method
to handle parsing the content.
|
|
onEnd()
For the most part, the onEnd() implementation was copied from
dojox.html._ContentSetter.
|
|
registerPostParse(postParseFunc)
Registers a post-parse callback to be triggered AFTER module dependencies have been
loaded and AFTER the HTML markup has been parsed.
|
|
registerPreParse(preParseFunc)
Registers a pre-parse callback to be triggered AFTER module dependencies have been
loaded but BEFORE the HTML markup has been parsed.
|
|
require(dependency)
Hook to allow href'd pages to require Dojo modules before the markup is parsed.
|
|
requireLocalization(packageName, bundleName)
Hook to allow href'd pages to require Dojo i18n modules before the markup is parsed.
|
|
This method should be called AFTER the JavaScript on the page has been executed.
|
|
tearDown()
Override to tear down the scriptsDeferred
|
Field Detail
{String} contentArgs
Parameters for the single child widget.
- Default Value:
- ""
{String} contentClass
Single child widget class.
- Default Value:
- ""
inferLabel
Flag indicating if the label should be inferred from the title in some cases.
Set this to false if you want the label to have to be explicitly set via the
"label" attribute.
label
The label to use for accessibility purposes. This will be added to an off-screen node
and the aria-labelledby attribute will be set on the dom node.
scriptHasHooks
Default "scriptHasHooks" to true. This differs from dojox.layout.ContentPane.
If using idx.layout.ContentPane, then most likely the reason is to get access to
_container_.require() and _container_.requireLocalization() as well as
_container_.registerPreParse() and _container_.registerPostParse()
Method Detail
buildRendering()
Sets up CSS class.
handleParse()
This funtion is essentially copied from dojo.html._ContentSetter's onEnd() method
to handle parsing the content. We have to delay parsing until all JavaScript in
the page has been executed (potentially asycnhronously) and then after we have called
the "preParse" callbacks (if any have been defined).
onEnd()
For the most part, the onEnd() implementation was copied from
dojox.html._ContentSetter. Differences include:
-- When a script is present, appending the "_scriptsExecuted" callback to the end
of the script to be notified when asynchronous execution completes
-- when no scripts are present ensuring processing is done synchronously and that
the "preParse()" and "postParse()" functions are called.
registerPostParse(postParseFunc)
Registers a post-parse callback to be triggered AFTER module dependencies have been
loaded and AFTER the HTML markup has been parsed. Each specified callback is
passed a single parameter that is an associative array of AMD-style module names
to the actual module that was loaded via "require" and "requireLocalization" functions.
For the "requireLocalization" function running under Dojo 1.6, an actual call to
"dojo.getLocalization" is done to obtain the bundle after requiring it. Modules that
were specified to "require()" function using AMD "slash notation" are excluded from
the associative array if running under Dojo 1.6. Localization modules are provided
under their AMD-style "dojo/i18n!" path. Example:
_container_.require("dojo/dom"); // for Dojo 1.7 or later
_container_.require("dijit.form.Button"); // for Dojo 1.6 or later
_container_.requireLocalization("ibm.myproduct", "messages");
_container_.registerPostParse(function(modules) {
// get the "dom" module for AMD or use "dojo" for legacy loader
var dom = modules["dojo/dom"] ? modules["dojo/dom"] : dojo;
var Button = modules["dijit/form/Button"]; // same for both AMD and legacy
var bundle = modules["dojo/i18n!ibm/myproduct/nls/messages"];
var node = dom.byId("buttonNode");
// progammatically create the widget
var button = new Button({label: bundle.buttonLabel}, node);
}
- Parameters:
- postParseFunc
registerPreParse(preParseFunc)
Registers a pre-parse callback to be triggered AFTER module dependencies have been
loaded but BEFORE the HTML markup has been parsed. Each specified callback is
passed a single parameter that is an associative array of AMD-style module names
to the actual module that was loaded via "require" and "requireLocalization" functions.
For the "requireLocalization" function running under Dojo 1.6, an actual call to
"dojo.getLocalization" is done to obtain the bundle after requiring it. Modules that
were specified to "require()" function using AMD "slash notation" are excluded from
the associative array if running under Dojo 1.6. Localization modules are provided
under their AMD-style "dojo/i18n!" path. Example:
var onChangeCallback = null;
_container_.registerPreParse(function(modules) {
// get the "dom" module for AMD or use "dojo" for legacy loader
var dom = modules["dojo/dom"] ? modules["dojo/dom"] : dojo;
onChangeCallback = new function(value) {
var node = dom.byId("messageNode");
messageNode.innerHTML = value;
}
}
- Parameters:
- preParseFunc
require(dependency)
Hook to allow href'd pages to require Dojo modules before the markup is parsed.
The specified dependency can take one of two forms:
- "foo.bar.phoo" -- Legacy "dot notation" for modules that are dependencies for
Dojo 1.6 and above. For Dojo 1.7 and above all dots/periods (".")
are replaced with forward slashes ("/").
- "foo/bar/phoo" -- AMD "slash notation" for modules that are dependencies for
Dojo 1.7 and above. These modules are not loaded if running
under Dojo 1.6.
Example:
_container_.require("dojo/dom"); // for Dojo 1.7 or later
_container_.require("dijit.form.Button"); // for Dojo 1.6 or later
- Parameters:
- dependency
requireLocalization(packageName, bundleName)
Hook to allow href'd pages to require Dojo i18n modules before the markup is parsed.
The dependency is specified in the legacy fashion like dojo.requireLocalization()
function. If running under Dojo 1.6, the dependency is loadded using
dojo.requireLocalization(). If running under Dojo 1.7 the dependency is translated
into "dojo/i18n!" + packageName + "/nls/" + bundleName. Where "packageName" has
every dot/period (".") replaced with a forward slash ("/").
Example:
_container_.requireLocalization("ibm.myproduct", "messages");
- Parameters:
- packageName
- bundleName
scriptsExecuted()
This method should be called AFTER the JavaScript on the page has been executed.
Calling this method is triggered by appending JavaScript to the JS code to
trigger a callback to the "scriptExecuted" function of the idx.layout.ContentPane.
The idx.layout.ContentPane in turn calls this function. Because script handling
is handled by dojox.layout.ContentPane via "script" tag injection, it was found
that actual script execution could happen asynchronously on some browsers. This
function essentially enables a callback for when the script has finished execution.
tearDown()
Override to tear down the scriptsDeferred