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.
Event Summary
scroll(oControlEvent)Scroll event. Method Summary
sap.ui.core.ScrollBar.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.core.ScrollBar with name sClassName
and enriches it with the information contained in oClassInfo
. attachScroll(oData?, fnFunction, oListener?)Attaches event handler fnFunction
to the scroll
event of this sap.ui.core.ScrollBar
. bind(oOwnerDomRef)Binds the mouse wheel scroll event of the control that has the scrollbar to the scrollbar itself. detachScroll(fnFunction, oListener)Detaches event handler fnFunction
from the scroll
event of this sap.ui.core.ScrollBar
. fireScroll(mArguments?)Fires event scroll
to attached listeners. getSize()Gets current value of property size
. getSteps()Gets current value of property steps
. pageDown()Page Down is used to scroll one page forward. pageUp()Page Up is used to scroll one page back. setContentSize(sContentSize)Sets a new value for property contentSize
. setSize(sSize)Sets a new value for property size
. setSteps(iSteps)Sets a new value for property steps
. setVertical(bVertical)Sets a new value for property vertical
. unbind(oOwnerDomRef)Unbinds the mouse wheel scroll event of the control that has the scrollbar addStyleClass,
allowTextSelection,
attachBrowserEvent,
attachValidateFieldGroup,
checkFieldGroupIds,
clone,
detachBrowserEvent,
detachValidateFieldGroup,
fireValidateFieldGroup,
getAccessibilityInfo,
getBusy,
getBusyIndicatorDelay,
getControlsByFieldGroupId,
getFieldGroupIds,
getIdForLabel,
getRenderer,
getVisible,
hasStyleClass,
invalidate,
isBusy,
placeAt,
removeStyleClass,
rerender,
setBusy,
setBusyIndicatorDelay,
setFieldGroupIds,
setVisible,
toggleStyleClass,
triggerValidateFieldGroup $,
addCustomData,
addDependent,
addEventDelegate,
applyFocusInfo,
bindElement,
data,
destroy,
destroyCustomData,
destroyDependents,
destroyLayoutData,
destroyTooltip,
enhanceAccessibilityState,
exit,
findElements,
fireEvent,
focus,
getCustomData,
getDependents,
getDomRef,
getElementBinding,
getFocusDomRef,
getFocusInfo,
getInterface,
getLayoutData,
getMetadata,
getTooltip,
getTooltip_AsString,
getTooltip_Text,
indexOfCustomData,
indexOfDependent,
insertCustomData,
insertDependent,
prop,
removeAllCustomData,
removeAllDependents,
removeCustomData,
removeDependent,
removeEventDelegate,
setLayoutData,
setTooltip,
toString,
unbindElement addAggregation,
addAssociation,
applySettings,
attachFormatError,
attachModelContextChange,
attachParseError,
attachValidationError,
attachValidationSuccess,
bindAggregation,
bindContext,
bindObject,
bindProperty,
destroyAggregation,
detachFormatError,
detachModelContextChange,
detachParseError,
detachValidationError,
detachValidationSuccess,
findAggregatedObjects,
fireFormatError,
fireModelContextChange,
fireParseError,
fireValidationError,
fireValidationSuccess,
getAggregation,
getAssociation,
getBinding,
getBindingContext,
getBindingInfo,
getBindingPath,
getEventingParent,
getId,
getModel,
getObjectBinding,
getOriginInfo,
getParent,
getProperty,
hasModel,
indexOfAggregation,
insertAggregation,
isBound,
isInvalidateSuppressed,
isTreeBinding,
propagateMessages,
removeAggregation,
removeAllAggregation,
removeAllAssociation,
removeAssociation,
setAggregation,
setAssociation,
setBindingContext,
setModel,
setProperty,
unbindAggregation,
unbindContext,
unbindObject,
unbindProperty,
validateAggregation,
validateProperty Constructor Detail
new sap.ui.core.ScrollBar(sId?, mSettings?)
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 for a general description of the syntax of the settings object.
The supported settings are:
- Properties
- Events
- scroll : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
In addition, all settings applicable to the base type sap.ui.core.Control can be used as well.
Parameters:
{string} | sId? | id for the new control, generated automatically if no id is given |
{object} | mSettings? | initial settings for the new control |
Event Detail
scroll(oControlEvent)
Scroll event.
Parameters:
{sap.ui.base.Event} | oControlEvent | |
{sap.ui.base.EventProvider} | oControlEvent.getSource | |
{object} | oControlEvent.getParameters | |
{sap.ui.core.ScrollBarAction} | oControlEvent.getParameters.action | Actions are: Click on track, button, drag of thumb, or mouse wheel click. |
{boolean} | oControlEvent.getParameters.forward | Direction of scrolling: back (up) or forward (down). |
{int} | oControlEvent.getParameters.newScrollPos | Current Scroll position either in pixels or in steps. |
{int} | oControlEvent.getParameters.oldScrollPos | Old Scroll position - can be in pixels or in steps. |
Method Detail
sap.ui.core.ScrollBar.extend(sClassName, oClassInfo?, FNMetaImpl?): function
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.
Parameters:
{string} | sClassName | Name of the class being created |
{object} | oClassInfo? | Object literal with information about the class |
{function} | FNMetaImpl? | Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata |
Returns:
{function} | Created class / constructor function |
Returns a metadata object for class sap.ui.core.ScrollBar.
Returns:
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.
Parameters:
{object} | oData? | An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
{function} | fnFunction | The function to be called when the event occurs |
{object} | oListener? | Context object to call the event handler with. Defaults to this sap.ui.core.ScrollBar itself |
Returns:
bind(oOwnerDomRef)
Binds the mouse wheel scroll event of the control that has the scrollbar to the scrollbar itself.
Parameters:
{string} | oOwnerDomRef | 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.
Parameters:
{function} | fnFunction | The function to be called, when the event occurs |
{object} | oListener | Context object on which the given function had to be called |
Returns:
Fires event
scroll
to attached listeners.
Expects the following event parameters:
action
of type sap.ui.core.ScrollBarAction
Actions are: Click on track, button, drag of thumb, or mouse wheel click.forward
of type boolean
Direction of scrolling: back (up) or forward (down).newScrollPos
of type int
Current Scroll position either in pixels or in steps.oldScrollPos
of type int
Old Scroll position - can be in pixels or in steps.
Parameters:
{Map} | mArguments? | The arguments to pass along with the event |
Returns:
Gets current value of property
contentSize
.
Size of the scrollable content (in pixels).
Returns:
getScrollPosition(): int
Gets current value of property
scrollPosition
.
Scroll position in steps or pixels.
Returns:
{int} | Value of property scrollPosition |
Gets current value of property
size
.
Size of the Scrollbar (in pixels).
Returns:
getSteps(): int
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.
Returns:
{int} | Value of property steps |
getVertical(): boolean
Gets current value of property
vertical
.
Orientation. Defines if the Scrollbar is vertical or horizontal.
Default value is true
.
Returns:
{boolean} | Value of property vertical |
pageDown()
Page Down is used to scroll one page forward.
pageUp()
Page Up is used to scroll one page back.
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.
Parameters:
Returns:
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.
Parameters:
{int} | iScrollPosition | New value for property scrollPosition |
Returns:
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.
Parameters:
Returns:
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.
Parameters:
{int} | iSteps | New value for property steps |
Returns:
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
.
Parameters:
{boolean} | bVertical | New value for property vertical |
Returns:
unbind(oOwnerDomRef)
Unbinds the mouse wheel scroll event of the control that has the scrollbar
Parameters:
{string} | oOwnerDomRef | Dom ref of the Control that uses the scrollbar |