Represents a container with scroll functionality, that can be used for text and controls. The Panel does not layout the embedded controls.
Constructor for a new Panel.
Accepts an object literal mSettings
that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject#constructor for a general description of the syntax of the settings object.
new sap.ui.commons.Panel(sId?, mSettings?)
Param | Type | Default Value | Description |
---|---|---|---|
sId? | string | ID for the new control, generated automatically if no ID is given |
|
mSettings? | object | Initial settings for the new control |
Name | Type | Default Value | Description |
---|---|---|---|
applyContentPadding | boolean | true | Determines whether the Panel will have padding. Padding is theme-dependent. Visibility: public |
areaDesign | sap.ui.commons.enums.AreaDesign | Fill | Determines the background color. Note that color settings are theme-dependent. Visibility: public |
borderDesign | sap.ui.commons.enums.BorderDesign | Box | Determines if the Panel can have a box as border. Note that displaying borders is theme-dependent. Visibility: public |
collapsed | boolean | false | Determines whether the Panel will be initially collapsed. When it is initially collapsed, the contents are not rendered. A collapsed Panel consumes less space than an expanded one. Visibility: public |
enabled | boolean | true | Represents the state of the of the Panel (enabled or disabled) Visibility: public |
height | sap.ui.core.CSSSize | Determines the height of the Panel in CSS size. Per default, the height for the Panel is automatically adjusted to the content. Dimension allows to explicitly specify the height. Visibility: public |
|
scrollLeft | int | 0 | Determines the scroll position from left to right. Value "0" means leftmost position. Visibility: public |
scrollTop | int | 0 | Determines the scroll position from top to bottom. Value "0" means topmost position. Visibility: public |
showCollapseIcon | boolean | true | Determines whether the Panel will have an icon for collapsing/expanding, or not. Visibility: public |
text | string | Specifies the text that is rendered in the Panel header. Can be used to create a simple titles that do not require an icon in the header. Visibility: public |
|
width | sap.ui.core.CSSSize | 100% | Determines the width of the Panel in CSS size. Visibility: public |
Default Aggregation: content
Name | Cardinality | Type | Description |
---|---|---|---|
buttons | 0..n | sap.ui.commons.Button |
The buttons that shall be displayed in the Panel header |
content (default) | 0..n | sap.ui.core.Control |
Aggregates the controls that are contained in the Panel. It is recommended to use a layout control as single direct child. When the Panel dimensions are set, the child control may have width and height of 100%. When the dimensions are not set, the child defines the size of the Panel. |
title | 0..1 | sap.ui.core.Title |
Aggregates the title element of the Panel. For text titles only, you alternatively could use setText() which also creates a title in the background. |
Method | Description |
---|---|
addButton |
Adds some button to the aggregation buttons. |
addContent |
Adds some content to the aggregation content. |
destroyButtons |
Destroys all the buttons in the aggregation buttons. |
destroyContent |
Destroys all the content in the aggregation content. |
destroyTitle |
Destroys the title in the aggregation title. |
sap.ui.commons.Panel.extend |
Creates a new subclass of class sap.ui.commons.Panel with name
|
getApplyContentPadding |
Gets current value of property applyContentPadding. Determines whether the Panel will have padding. Padding is theme-dependent. Default value is |
getAreaDesign |
Gets current value of property areaDesign. Determines the background color. Note that color settings are theme-dependent. Default value is |
getBorderDesign |
Gets current value of property borderDesign. Determines if the Panel can have a box as border. Note that displaying borders is theme-dependent. Default value is |
getButtons |
Gets content of aggregation buttons. The buttons that shall be displayed in the Panel header |
getCollapsed |
Gets current value of property collapsed. Determines whether the Panel will be initially collapsed. When it is initially collapsed, the contents are not rendered. A collapsed Panel consumes less space than an expanded one. Default value is |
getContent |
Gets content of aggregation content. Aggregates the controls that are contained in the Panel. It is recommended to use a layout control as single direct child. When the Panel dimensions are set, the child control may have width and height of 100%. When the dimensions are not set, the child defines the size of the Panel. |
getEnabled |
Gets current value of property enabled. Represents the state of the of the Panel (enabled or disabled) Default value is |
getFocusInfo |
Returns an object representing the serialized focus information. |
getHeight |
Gets current value of property height. Determines the height of the Panel in CSS size. Per default, the height for the Panel is automatically adjusted to the content. Dimension allows to explicitly specify the height. |
sap.ui.commons.Panel.getMetadata |
Returns a metadata object for class sap.ui.commons.Panel. |
getScrollLeft |
Returns the scroll position of the panel in pixels from the left. Returns 0 if not rendered yet. Also internally updates the control property. |
getScrollTop |
Returns the scroll position of the panel in pixels from the top. Returns 0 if not rendered yet. Also internally updates the control property. |
getShowCollapseIcon |
Gets current value of property showCollapseIcon. Determines whether the Panel will have an icon for collapsing/expanding, or not. Default value is |
getText |
Returns the text that is rendered in the Panel header. If a Title control was used it returns the text of the Title control. |
getTitle |
Gets content of aggregation title. Aggregates the title element of the Panel. For text titles only, you alternatively could use setText() which also creates a title in the background. |
getWidth |
Gets current value of property width. Determines the width of the Panel in CSS size. Default value is |
indexOfButton |
Checks for the provided |
indexOfContent |
Checks for the provided |
insertButton |
Inserts a button into the aggregation buttons. |
insertContent |
Inserts a content into the aggregation content. |
removeAllButtons |
Removes all the controls from the aggregation buttons. Additionally, it unregisters them from the hosting UIArea. |
removeAllContent |
Removes all the controls from the aggregation content. Additionally, it unregisters them from the hosting UIArea. |
removeButton |
Removes a button from the aggregation buttons. |
removeContent |
Removes a content from the aggregation content. |
setApplyContentPadding |
Property setter for the padding |
setAreaDesign |
Sets a new value for property areaDesign. Determines the background color. Note that color settings are theme-dependent. When called with a value of Default value is |
setBorderDesign |
Sets a new value for property borderDesign. Determines if the Panel can have a box as border. Note that displaying borders is theme-dependent. When called with a value of Default value is |
setCollapsed |
Property setter for the "collapsed" state |
setDimensions |
Sets the dimensions of the panel. |
setEnabled |
Property setter for the "enabled" state |
setHeight |
Sets the height of the panel. |
setScrollLeft |
Sets the scroll position of the panel in pixels from the left. |
setScrollTop |
Sets the scrolls position of the panel in pixels from the top. |
setShowCollapseIcon |
Sets a new value for property showCollapseIcon. Determines whether the Panel will have an icon for collapsing/expanding, or not. When called with a value of Default value is |
setText |
Sets the text that will be rendered in the Panel header. |
setTitle |
Sets a Tille control that will be rendered in the Panel header. |
setWidth |
Sets the width of the panel. |
Adds some button to the aggregation buttons.
Param | Type | DefaultValue | Description |
---|---|---|---|
oButton | sap.ui.commons.Button |
The button to add; if empty, nothing is inserted |
Adds some content to the aggregation content.
Param | Type | DefaultValue | Description |
---|---|---|---|
oContent | sap.ui.core.Control |
The content to add; if empty, nothing is inserted |
Creates a new subclass of class sap.ui.commons.Panel with name sClassName
and enriches it with the information contained in oClassInfo
.
oClassInfo
might contain the same kind of information as described in sap.ui.core.Control.extend.
Param | Type | DefaultValue | Description |
---|---|---|---|
sClassName | string |
Name of the class being created |
|
oClassInfo | object |
Object literal with information about the class |
|
FNMetaImpl | function |
Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class |
Gets current value of property applyContentPadding.
Determines whether the Panel will have padding. Padding is theme-dependent.
Default value is true
.
Gets current value of property areaDesign.
Determines the background color. Note that color settings are theme-dependent.
Default value is Fill
.
Gets current value of property borderDesign.
Determines if the Panel can have a box as border. Note that displaying borders is theme-dependent.
Default value is Box
.
Gets content of aggregation buttons.
The buttons that shall be displayed in the Panel header
Gets current value of property collapsed.
Determines whether the Panel will be initially collapsed. When it is initially collapsed, the contents are not rendered. A collapsed Panel consumes less space than an expanded one.
Default value is false
.
Gets content of aggregation content.
Aggregates the controls that are contained in the Panel. It is recommended to use a layout control as single direct child. When the Panel dimensions are set, the child control may have width and height of 100%. When the dimensions are not set, the child defines the size of the Panel.
Gets current value of property enabled.
Represents the state of the of the Panel (enabled or disabled)
Default value is true
.
Gets current value of property height.
Determines the height of the Panel in CSS size. Per default, the height for the Panel is automatically adjusted to the content. Dimension allows to explicitly specify the height.
Returns the scroll position of the panel in pixels from the left. Returns 0 if not rendered yet. Also internally updates the control property.
Returns the scroll position of the panel in pixels from the top. Returns 0 if not rendered yet. Also internally updates the control property.
Gets current value of property showCollapseIcon.
Determines whether the Panel will have an icon for collapsing/expanding, or not.
Default value is true
.
Returns the text that is rendered in the Panel header. If a Title control was used it returns the text of the Title control.
Gets content of aggregation title.
Aggregates the title element of the Panel. For text titles only, you alternatively could use setText() which also creates a title in the background.
Gets current value of property width.
Determines the width of the Panel in CSS size.
Default value is '100%'
.
Checks for the provided sap.ui.commons.Button
in the aggregation buttons. and returns its index if found or -1 otherwise.
Param | Type | DefaultValue | Description |
---|---|---|---|
oButton | sap.ui.commons.Button |
The button whose index is looked for |
Checks for the provided sap.ui.core.Control
in the aggregation content. and returns its index if found or -1 otherwise.
Param | Type | DefaultValue | Description |
---|---|---|---|
oContent | sap.ui.core.Control |
The content whose index is looked for |
Inserts a button into the aggregation buttons.
Param | Type | DefaultValue | Description |
---|---|---|---|
oButton | sap.ui.commons.Button |
The button to insert; if empty, nothing is inserted |
|
iIndex | int |
The |
Inserts a content into the aggregation content.
Param | Type | DefaultValue | Description |
---|---|---|---|
oContent | sap.ui.core.Control |
The content to insert; if empty, nothing is inserted |
|
iIndex | int |
The |
Removes all the controls from the aggregation buttons.
Additionally, it unregisters them from the hosting UIArea.
Removes all the controls from the aggregation content.
Additionally, it unregisters them from the hosting UIArea.
Removes a button from the aggregation buttons.
Param | Type | DefaultValue | Description |
---|---|---|---|
vButton | int string sap.ui.commons.Button |
The button to remove or its index or id |
Removes a content from the aggregation content.
Param | Type | DefaultValue | Description |
---|---|---|---|
vContent | int string sap.ui.core.Control |
The content to remove or its index or id |
Property setter for the padding
Param | Type | DefaultValue | Description |
---|---|---|---|
bPadding | boolean |
Whether the Panel should have padding. |
Sets a new value for property areaDesign.
Determines the background color. Note that color settings are theme-dependent.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is Fill
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sAreaDesign | sap.ui.commons.enums.AreaDesign | Fill |
New value for property |
Sets a new value for property borderDesign.
Determines if the Panel can have a box as border. Note that displaying borders is theme-dependent.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is Box
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sBorderDesign | sap.ui.commons.enums.BorderDesign | Box |
New value for property |
Property setter for the "collapsed" state
Param | Type | DefaultValue | Description |
---|---|---|---|
bCollapsed | boolean |
Whether the Panel should be collapsed or not. |
Sets the dimensions of the panel.
Param | Type | DefaultValue | Description |
---|---|---|---|
sWidth | sap.ui.core.CSSSize |
The width of the panel as CSS size. |
|
sHeight | sap.ui.core.CSSSize |
The height of the panel as CSS size. |
Property setter for the "enabled" state
Param | Type | DefaultValue | Description |
---|---|---|---|
bEnabled | boolean |
Whether the Panel should be enabled or not. |
Sets the height of the panel.
Param | Type | DefaultValue | Description |
---|---|---|---|
sHeight | sap.ui.core.CSSSize |
The height of the panel as CSS size. |
Sets the scroll position of the panel in pixels from the left.
Param | Type | DefaultValue | Description |
---|---|---|---|
iPosition | int |
The position to scroll to. |
Sets the scrolls position of the panel in pixels from the top.
Param | Type | DefaultValue | Description |
---|---|---|---|
iPosition | int |
The position to scroll to. |
Sets a new value for property showCollapseIcon.
Determines whether the Panel will have an icon for collapsing/expanding, or not.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is true
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bShowCollapseIcon | boolean | true |
New value for property |
Sets the text that will be rendered in the Panel header.
Param | Type | DefaultValue | Description |
---|---|---|---|
sText | string |
The text to render in the header. |
Sets a Tille control that will be rendered in the Panel header.
Param | Type | DefaultValue | Description |
---|---|---|---|
oTitle | sap.ui.core.Title |
The Title to render in the header. |
Sets the width of the panel.
Param | Type | DefaultValue | Description |
---|---|---|---|
sWidth | sap.ui.core.CSSSize |
The width of the panel as CSS size. |