The root container for a page and thus it should be the only one in a page.
Table of contents
All user panels - CP and UX1
For correct functioning of the user interface, all widgets regardless of
the way they are declared, must be placed inside the root aps/PageContainer
considered in this document.
Find the nested rules in the recommended Widget Hierarchy.
The root container contains a MessageList
property that is a pointer
to the list of messages displayed on the screen.
If you want to output a certain message to the screen, you need to get
the list of messages using the get
method and add a new message to
the list. To clear all messages from the list, you may use the
removeAll
method.
require(["aps/PageContainer", "aps/Message", "aps/ready!"],
function(PageContainer, Message){
var page = new PageContainer({}, "mainPage");
page.get("messageList").addChild(new Message({
description: "Text <a href=\"javascript:void(0)\">Link</a>",
type: "progress"
}));
page.startup();
setTimeout(function(){
// page.get("messageList").removeAll(); // Uncomment to remove message
page.get("messageList").addChild(new Message({
description: "Text<a href=\"javascript:void(0)\">Link</a>",
type: "error"
}));
}, 1000);
});
<div id="mainPage"></div>
For more detailed information about working with the aps/MessageList
and aps/Message
widgets see the aps/MessageList document.
If your view has input widgets and you want to check correctness of the input data, you just need to call the validate method of the aps/PageContainer widget. If the data are correct, the method returns true, otherwise the method returns false and sets focus on the element where the user made a mistake while inputting data.
require(["aps/load", "aps/ready!"],
function(load){
load([ "aps/PageContainer", [
["aps/Panel", [
[ "aps/Container", {
title: "Management of access to the server over SSH "
},[
[ "aps/RadioButton", {
description: "Not allowed",
checked: "checked",
name: "allow"
}],
[ "aps/RadioButton", {
description: "Can allow access only to a chrooted"+
"environment", name: "allow"
}],
[ "aps/RadioButton", {
description: "Can allow access to any type of shell",
name: "allow"
}]
]]]]]]);
});
require([
"aps/PageContainer",
"aps/Panel",
"aps/Container",
"aps/RadioButton",
"aps/ready!"],
function(PageContainer, Panel, Container, RadioButton) {
var page = new PageContainer();
var panel = new Panel();
var con = new Container({
title: "Management of access to the server over SSH "
});
page.addChild(panel);
panel.addChild(con);
con.addChild(new RadioButton({
description: "Not allowed",
checked: "checked",
name: "allow"
}));
con.addChild(new RadioButton({
description: "Can allow access only to a chrooted" + "environment",
name: "allow"
}));
con.addChild(new RadioButton({
description: "Can allow access to any type of shell",
name: "allow"
}));
page.placeAt("mainPage");
});
PROPERTY |
TYPE |
DEFAULT |
DESCRIPTION |
---|---|---|---|
object |
null |
Singleton list of messages. |
Singleton list of messages. Default value: null.
METHOD |
RETURN |
DESCRIPTION |
---|---|---|
undefined
|
Makes the given widget a child of this widget |
|
undefined
|
Destroys this widget, but not its descendants |
|
aps/_containerbase
function
|
Focusing the focusable child |
|
array
|
Returns all direct children of this widget, i |
|
dijit/_widgetbase
function
|
Place this widget somewhere in the DOM based on standard dojo/dom-construct::place() conventions |
|
undefined
|
Remove all children in the widget |
|
undefined
|
Removes the passed widget instance from this widget and destroys it |
|
undefined
|
Resets the widget |
|
undefined
|
Processing after the DOM fragment is added to the document |
|
boolean
|
Called by oninit, onblur, and onkeypress |
Makes the given widget a child of this widget. Inserts specified child widget’s dom node as a child of this widget’s container node, and possibly does other processing (such as layout).
Return: undefined
ARGUMENT |
TYPE |
DESCRIPTION |
---|---|---|
|
Widget
|
Child widget |
|
Number
String
|
Position child in the parent widget |
Destroys this widget, but not its descendants. Descendants are the widgets inside this.containerNode. Will also destroy any resources (including widgets) registered via this.own().
Return: undefined
Returns all direct children of this widget, i.e. all widgets underneath this.containerNode whose parent is this widget. Note that it returns not all descendetns, but only the direct children. Analogous to Node.childNodes, except containing widgets rather than DOMNodes.
The result intentionally excludes internally created widgets (a.k.a. supporting widgets) outside of this.containerNode.
Note the returned array is a simple array. The application code should not assume existence of methods like forEach().
Return: array
Place this widget somewhere in the DOM based on standard dojo/dom-construct::place() conventions. A convenience function providing a simple shorthand mechanism to put an existing (or newly created) widget somewhere in the DOM, and allow chaining.
Return: dijit/_widgetbase function
Removes the passed widget instance from this widget and destroys it. You can also pass in an integer indicating the index within the container to remove (ie, removeChild(5) removes the sixth widget).
Return: undefined
ARGUMENT |
TYPE |
DESCRIPTION |
---|---|---|
|
Widget
Int
|
Child widget or index |
Processing after the DOM fragment is added to the document. Called after a widget and its children have been created and added to the page and all related widgets have finished their creation cycle, that is after the postCreate() function is successfully completed for each of the related widgets. Note that startup() may be called while the widget is still hidden.
Return: undefined
Called by oninit, onblur, and onkeypress. Show missing or invalid messages if appropriate, and highlight textbox field.
Return: boolean