Event Summary
selectionChanged(oControlEvent)This event is fired when the nodes are selected/unselected. visibilityChanged(oControlEvent)This event is fired when the visibility of the node changes. Method Summary
sap.ui.vk.ViewStateManager.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.vk.ViewStateManager with name sClassName
and enriches it with the information contained in oClassInfo
. attachSelectionChanged(oData?, fnFunction, oListener?)Attaches event handler fnFunction
to the selectionChanged
event of this sap.ui.vk.ViewStateManager
. attachVisibilityChanged(oData?, fnFunction, oListener?)Attaches event handler fnFunction
to the visibilityChanged
event of this sap.ui.vk.ViewStateManager
. detachSelectionChanged(fnFunction, oListener)Detaches event handler fnFunction
from the selectionChanged
event of this sap.ui.vk.ViewStateManager
. detachVisibilityChanged(fnFunction, oListener)Detaches event handler fnFunction
from the visibilityChanged
event of this sap.ui.vk.ViewStateManager
. getNodeHierarchy()Gets the NodeHierarchy object associated with this ViewStateManager object. setSelectionState(nodeIds, selected, recursive)Sets the selection state of the nodes. addAggregation,
addAssociation,
applySettings,
attachFormatError,
attachModelContextChange,
attachParseError,
attachValidationError,
attachValidationSuccess,
bindAggregation,
bindContext,
bindObject,
bindProperty,
clone,
destroy,
destroyAggregation,
detachFormatError,
detachModelContextChange,
detachParseError,
detachValidationError,
detachValidationSuccess,
findAggregatedObjects,
fireFormatError,
fireModelContextChange,
fireParseError,
fireValidationError,
fireValidationSuccess,
getAggregation,
getAssociation,
getBinding,
getBindingContext,
getBindingInfo,
getBindingPath,
getEventingParent,
getId,
getMetadata,
getModel,
getObjectBinding,
getOriginInfo,
getParent,
getProperty,
hasModel,
indexOfAggregation,
insertAggregation,
invalidate,
isBound,
isInvalidateSuppressed,
isTreeBinding,
propagateMessages,
removeAggregation,
removeAllAggregation,
removeAllAssociation,
removeAssociation,
setAggregation,
setAssociation,
setBindingContext,
setModel,
setProperty,
toString,
unbindAggregation,
unbindContext,
unbindObject,
unbindProperty,
validateAggregation,
validateProperty Constructor Detail
new sap.ui.vk.ViewStateManager(nodeHierarchy)
Constructor for a new ViewStateManager.
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:
- Events
- visibilityChanged : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
- selectionChanged : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
In addition, all settings applicable to the base type sap.ui.base.ManagedObject can be used as well.
Parameters:
Event Detail
selectionChanged(oControlEvent)
This event is fired when the nodes are selected/unselected.
Parameters:
{sap.ui.base.Event} | oControlEvent | |
{sap.ui.base.EventProvider} | oControlEvent.getSource | |
{object} | oControlEvent.getParameters | |
{string[]} | oControlEvent.getParameters.selected | IDs of newly selected nodes. |
{string[]} | oControlEvent.getParameters.unselected | IDs of newly unselected nodes. |
visibilityChanged(oControlEvent)
This event is fired when the visibility of the node changes.
Parameters:
{sap.ui.base.Event} | oControlEvent | |
{sap.ui.base.EventProvider} | oControlEvent.getSource | |
{object} | oControlEvent.getParameters | |
{string[]} | oControlEvent.getParameters.visible | IDs of newly shown nodes. |
{string[]} | oControlEvent.getParameters.hidden | IDs of newly hidden nodes. |
Method Detail
sap.ui.vk.ViewStateManager.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.vk.ViewStateManager 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.base.ManagedObject.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.vk.ViewStateManager.
Returns:
Attaches event handler
fnFunction
to the
selectionChanged
event of this
sap.ui.vk.ViewStateManager
.
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.vk.ViewStateManager
itself.
This event is fired when the nodes are selected/unselected.
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.vk.ViewStateManager itself |
Returns:
Attaches event handler
fnFunction
to the
visibilityChanged
event of this
sap.ui.vk.ViewStateManager
.
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.vk.ViewStateManager
itself.
This event is fired when the visibility of the node changes.
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.vk.ViewStateManager itself |
Returns:
Detaches event handler
fnFunction
from the
selectionChanged
event of this
sap.ui.vk.ViewStateManager
.
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:
Detaches event handler
fnFunction
from the
visibilityChanged
event of this
sap.ui.vk.ViewStateManager
.
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:
Enumerates IDs of the selected nodes.
Parameters:
{function} | callback | A function to call when the selected nodes are enumerated. The function takes one parameter of type string . |
Returns:
Fires event
selectionChanged
to attached listeners.
Expects the following event parameters:
selected
of type string[]
IDs of newly selected nodes.unselected
of type string[]
IDs of newly unselected nodes.
Parameters:
{Map} | mArguments? | The arguments to pass along with the event |
Returns:
Fires event
visibilityChanged
to attached listeners.
Expects the following event parameters:
visible
of type string[]
IDs of newly shown nodes.hidden
of type string[]
IDs of newly hidden nodes.
Parameters:
{Map} | mArguments? | The arguments to pass along with the event |
Returns:
Gets the NodeHierarchy object associated with this ViewStateManager object.
Returns:
getSelectionState(nodeIds): boolean|boolean[]
Gets the selection state of the node.
If a single node ID is passed to the method then a single selection state is returned.
If an array of node IDs is passed to the method then an array of selection states is returned.
Parameters:
{string|string[]} | nodeIds | The node ID or the array of node IDs. |
Returns:
{boolean|boolean[]} | A single value or an array of values where the value is true if the node is selected, false otherwise. |
getVisibilityState(nodeIds): boolean|boolean[]
Gets the visibility state of nodes.
If a single node ID is passed to the method then a single visibility state is returned.
If an array of node IDs is passed to the method then an array of visibility states is returned.
Parameters:
{string|string[]} | nodeIds | The node ID or the array of node IDs. |
Returns:
{boolean|boolean[]} | A single value or an array of values where the value is true if the node is visible, false otherwise. |
Sets the selection state of the nodes.
Parameters:
{string|string[]} | nodeIds | The node ID or the array of node IDs. |
{boolean} | selected | The new selection state of the nodes. |
{boolean} | recursive | The flags indicates if the change needs to propagate recursively to child nodes. |
Returns:
Sets the visibility state of the nodes.
Parameters:
{string|string[]} | nodeIds | The node ID or the array of node IDs. |
{boolean} | visible | The new visibility state of the nodes. |
{boolean} | recursive | The flags indicates if the change needs to propagate recursively to child nodes. |
Returns: