The ScrollBar control can be used for virtual scrolling of a certain area. This means: to simulate a very large scrollable area when technically the area is small and the control takes care of displaying the respective part only. E.g. a Table control can take care of only rendering the currently visible rows and use this ScrollBar control to make the user think he actually scrolls through a long list.
Constructor for a new ScrollBar.
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.core.ScrollBar(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 |
---|---|---|---|
contentSize | sap.ui.core.CSSSize | Size of the scrollable content (in pixels). Visibility: public |
|
scrollPosition | int | Scroll position in steps or pixels. Visibility: public |
|
size | sap.ui.core.CSSSize | Size of the Scrollbar (in pixels). Visibility: public |
|
steps | int | Number of steps to scroll. Used if the size of the content is not known as the data is loaded dynamically. Visibility: public |
|
vertical | boolean | true | Orientation. Defines if the Scrollbar is vertical or horizontal. Visibility: public |
Name | Type | Default Value | Description |
---|---|---|---|
blocked | boolean | false | Whether the control is currently in blocked state. Visibility: public |
busy | boolean | false | Whether the control is currently in busy state. Visibility: public |
busyIndicatorDelay | int | 1000 | The delay in milliseconds, after which the busy indicator will show up for this control. Visibility: public |
busyIndicatorSize | sap.ui.core.BusyIndicatorSize | Medium | The size of the BusyIndicator. For controls with a width smaller 3rem a |
fieldGroupIds | string[] | The IDs of a logical field group that this control belongs to. All fields in a logical field group should share the same For backward compatibility with older releases, field group IDs are syntactically not limited, but it is suggested to use only valid sap.ui.core.IDs. See #attachValidateFieldGroup or consult the Field Group documentation. |
|
visible | boolean | true | Whether the control should be visible on the screen. If set to false, a placeholder will be rendered to mark the location of the invisible control in the DOM of the current page. The placeholder will be hidden and have zero dimensions ( Also see InvisibleRenderer. Visibility: public |
Name | Cardinality | Type | Description |
---|---|---|---|
customData | 0..n | sap.ui.core.CustomData |
Custom Data, a data structure like a map containing arbitrary key value pairs. |
dependents | 0..n | sap.ui.core.Element |
Dependents are not rendered, but their databinding context and lifecycle are bound to the aggregating Element. |
dragDropConfig | 0..n | sap.ui.core.dnd.DragDropBase |
Defines the drag-and-drop configuration. Note: This configuration might be ignored due to control metadata restrictions. |
layoutData | 0..1 | sap.ui.core.LayoutData |
Defines the layout constraints for this control when it is used inside a Layout. LayoutData classes are typed classes and must match the embedding Layout. See VariantLayoutData for aggregating multiple alternative LayoutData instances to a single Element. |
tooltip | 0..1 | sap.ui.core.TooltipBase |
The tooltip that should be shown for this Element. In the most simple case, a tooltip is a string that will be rendered by the control and displayed by the browser when the mouse pointer hovers over the control's DOM. In this variant, Controls need to explicitly support this kind of tooltip as they have to render it, but most controls do. Exceptions will be documented for the corresponding controls (e.g. Alternatively, UI5 currently does not provide a recommended implementation of See the section Using Tooltips
|
Scroll event.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
action | sap.ui.core.ScrollBarAction |
Actions are: Click on track, button, drag of thumb, or mouse wheel click. |
forward | boolean |
Direction of scrolling: back (up) or forward (down). |
newScrollPos | int |
Current Scroll position either in pixels or in steps. |
oldScrollPos | int |
Old Scroll position - can be in pixels or in steps. |
Method | Description |
---|---|
attachScroll |
Attaches event handler When called, the context of the event handler (its Scroll event. |
bind |
Binds the mouse wheel scroll event of the control that has the scrollbar to the scrollbar itself. |
detachScroll |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
sap.ui.core.ScrollBar.extend |
Creates a new subclass of class sap.ui.core.ScrollBar with name
|
fireScroll |
Fires event scroll to attached listeners. |
getContentSize |
Gets current value of property contentSize. Size of the scrollable content (in pixels). |
sap.ui.core.ScrollBar.getMetadata |
Returns a metadata object for class sap.ui.core.ScrollBar. |
getScrollPosition |
Gets current value of property scrollPosition. Scroll position in steps or pixels. |
getSize |
Gets current value of property size. Size of the Scrollbar (in pixels). |
getSteps |
Gets current value of property steps. Number of steps to scroll. Used if the size of the content is not known as the data is loaded dynamically. |
getVertical |
Gets current value of property vertical. Orientation. Defines if the Scrollbar is vertical or horizontal. Default value is |
pageDown |
Page Down is used to scroll one page forward. |
pageUp |
Page Up is used to scroll one page back. |
setContentSize |
Sets a new value for property contentSize. Size of the scrollable content (in pixels). When called with a value of |
setScrollPosition |
Sets a new value for property scrollPosition. Scroll position in steps or pixels. When called with a value of |
setSize |
Sets a new value for property size. Size of the Scrollbar (in pixels). When called with a value of |
setSteps |
Sets a new value for property steps. Number of steps to scroll. Used if the size of the content is not known as the data is loaded dynamically. When called with a value of |
setVertical |
Sets a new value for property vertical. Orientation. Defines if the Scrollbar is vertical or horizontal. When called with a value of Default value is |
unbind |
Unbinds the mouse wheel scroll event of the control that has the scrollbar |
Attaches event handler fnFunction
to the scroll event of this sap.ui.core.ScrollBar
.
When called, the context of the event handler (its this
) will be bound to oListener
if specified, otherwise it will be bound to this sap.ui.core.ScrollBar
itself.
Scroll event.
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
Binds the mouse wheel scroll event of the control that has the scrollbar to the scrollbar itself.
Param | Type | DefaultValue | Description |
---|---|---|---|
oOwnerDomRef | string |
Dom ref of the control that uses the scrollbar |
Detaches event handler fnFunction
from the scroll event of this sap.ui.core.ScrollBar
.
The passed function and listener object must match the ones used for event registration.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
Creates a new subclass of class sap.ui.core.ScrollBar 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 |
Fires event scroll to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
action | sap.ui.core.ScrollBarAction |
Actions are: Click on track, button, drag of thumb, or mouse wheel click. |
|
forward | boolean |
Direction of scrolling: back (up) or forward (down). |
|
newScrollPos | int |
Current Scroll position either in pixels or in steps. |
|
oldScrollPos | int |
Old Scroll position - can be in pixels or in steps. |
Gets current value of property contentSize.
Size of the scrollable content (in pixels).
Gets current value of property steps.
Number of steps to scroll. Used if the size of the content is not known as the data is loaded dynamically.
Gets current value of property vertical.
Orientation. Defines if the Scrollbar is vertical or horizontal.
Default value is true
.
Sets a new value for property contentSize.
Size of the scrollable content (in pixels).
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
sContentSize | sap.ui.core.CSSSize |
New value for property |
Sets a new value for property scrollPosition.
Scroll position in steps or pixels.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
iScrollPosition | int |
New value for property |
Sets a new value for property size.
Size of the Scrollbar (in pixels).
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
sSize | sap.ui.core.CSSSize |
New value for property |
Sets a new value for property steps.
Number of steps to scroll. Used if the size of the content is not known as the data is loaded dynamically.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
iSteps | int |
New value for property |
Sets a new value for property vertical.
Orientation. Defines if the Scrollbar is vertical or horizontal.
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 |
---|---|---|---|
bVertical | boolean | true |
New value for property |