Class sap.ca.ui.PictureViewerModule: sap/ca/ui/PictureViewer


Picture viewer control relying on the TileContainer control

Deprecated API:Since version 1.22. PictureViewer was replacing the Carousel as it wasn't supporting some versions of MS Internet Explorer. Now, the sap.m.Carousel is fully functional, please use sap.m.Carousel instead. This control will not be supported anymore.

Constructor Summary
new sap.ca.ui.PictureViewer(sId?, mSettings?)Constructor for a new PictureViewer.
Event Summary
pictureDeleted(oControlEvent)Thrown when user delete an image
Events borrowed from class sap.m.TileContainer
Events borrowed from class sap.ui.core.Control
Method Summary
sap.ca.ui.PictureViewer.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ca.ui.PictureViewer with name sClassName and enriches it with the information contained in oClassInfo.
sap.ca.ui.PictureViewer.getMetadata()Returns a metadata object for class sap.ca.ui.PictureViewer.
attachPictureDeleted(oData?, fnFunction, oListener?)Attach event handler fnFunction to the 'pictureDeleted' event of this sap.ca.ui.PictureViewer.
deletePicture(iIndex, iIndex)Removes the picture at index iIndex from the items aggregation.
destroyItems()Destroys all the items in the aggregation named items.
detachPictureDeleted(fnFunction, oListener)Detach event handler fnFunction from the 'pictureDeleted' event of this sap.ca.ui.PictureViewer.
firePictureDeleted(mArguments?)Fire event pictureDeleted to attached listeners.
getCurrentPictureIndex()Gets the current picture index.
getItems()Getter for aggregation items.
getRemovable()Getter for property removable.
getTileScaling()Getter for property tileScaling.
indexOfItem(oItem)Checks for the provided sap.ca.ui.PictureViewerItem in the aggregation named items and returns its index if found or -1 otherwise.
removeAllItems()Removes all the controls in the aggregation named items.
removeItem(vItem)Removes an item from the aggregation named items.
selectPicture(iIndex, iIndex)Select the picture at index iIndex from the items aggregation.
setRemovable()Specify whether or not you can delete a picture.
setTileScaling(fTileScale)Set the percentage of the space occupied by the image in the picture viewer control.
addItem(oItem)Adds some item oItem to the aggregation named items.
insertItem(oItem, iIndex)Inserts a item into the aggregation named items.
Constructor Detail
new sap.ca.ui.PictureViewer(sId?, mSettings?)
Constructor for a new PictureViewer.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers.

If the name of a setting is ambiguous (e.g. a property has the same name as an event), then the framework assumes property, aggregation, association, event in that order. To override this automatic resolution, one of the prefixes "aggregation:", "association:" or "event:" can be added to the name of the setting (such a prefixed name must be enclosed in single or double quotes).

The supported settings are:

  • Properties
  • Aggregations
    • items(default aggregation) : sap.ca.ui.PictureViewerItem[]
  • Associations
    • Events
      • pictureDeleted : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]

    In addition, all settings applicable to the base type sap.m.TileContainer 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
    Deprecated:
    Since version 1.22. PictureViewer was replacing the Carousel as it wasn't supporting some versions of MS Internet Explorer. Now, the sap.m.Carousel is fully functional, please use sap.m.Carousel instead. This control will not be supported anymore.
    Event Detail
    pictureDeleted(oControlEvent)
    Thrown when user delete an image
    Parameters:
    {sap.ui.base.Event}oControlEvent
    {sap.ui.base.EventProvider}oControlEvent.getSource
    {object}oControlEvent.getParameters
    Method Detail
    sap.ca.ui.PictureViewer.extend(sClassName, oClassInfo?, FNMetaImpl?): function
    Creates a new subclass of class sap.ca.ui.PictureViewer with name sClassName and enriches it with the information contained in oClassInfo.

    oClassInfo might contain the same kind of informations as described in Element.extend.

    Parameters:
    {string}sClassName name of the class to be created
    {object}oClassInfo? object literal with informations about the class
    {function}FNMetaImpl? constructor function for the metadata object. If not given, it defaults to sap.ui.core.ElementMetadata.
    Returns:
    {function} the created class / constructor function
    sap.ca.ui.PictureViewer.getMetadata(): sap.ui.base.Metadata
    Returns a metadata object for class sap.ca.ui.PictureViewer.
    Returns:
    {sap.ui.base.Metadata} Metadata object describing this class
    attachPictureDeleted(oData?, fnFunction, oListener?): sap.ca.ui.PictureViewer
    Attach event handler fnFunction to the 'pictureDeleted' event of this sap.ca.ui.PictureViewer.
    . When called, the context of the event handler (its this) will be bound to oListener if specified otherwise to this sap.ca.ui.PictureViewer.
    itself.

    Thrown when user delete an image

    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 call, when the event occurs.
    {object}oListener? Context object to call the event handler with. Defaults to this sap.ca.ui.PictureViewer.
    itself.
    Returns:
    {sap.ca.ui.PictureViewer}this to allow method chaining
    deletePicture(iIndex, iIndex): sap.ca.ui.PictureViewer
    Removes the picture at index iIndex from the items aggregation.
    Parameters:
    {sap.ca.ui.PictureViewerItem}iIndex the index of the picture to delete; if empty, the current picture is deleted
    {int}iIndex the 0-based index of the picture collection to delete; if iIndex is out of range or empty, the current image will be deleted.
    Returns:
    {sap.ca.ui.PictureViewer}this to allow method chaining
    destroyItems(): sap.ca.ui.PictureViewer
    Destroys all the items in the aggregation named items.
    Returns:
    {sap.ca.ui.PictureViewer}this to allow method chaining
    detachPictureDeleted(fnFunction, oListener): sap.ca.ui.PictureViewer
    Detach event handler fnFunction from the 'pictureDeleted' event of this sap.ca.ui.PictureViewer.

    The passed function and listener object must match the ones used for event registration.

    Parameters:
    {function}fnFunction The function to call, when the event occurs.
    {object}oListener Context object on which the given function had to be called.
    Returns:
    {sap.ca.ui.PictureViewer}this to allow method chaining
    firePictureDeleted(mArguments?): sap.ca.ui.PictureViewer
    Fire event pictureDeleted to attached listeners.
    Parameters:
    {Map}mArguments? the arguments to pass along with the event.
    Returns:
    {sap.ca.ui.PictureViewer}this to allow method chaining
    getCurrentPictureIndex(): sap.ca.ui.PictureViewer
    Gets the current picture index.
    Returns:
    {sap.ca.ui.PictureViewer} the current picture index
    Getter for aggregation items.
    Aggregation of PictureViewerItem that contains either a picture URI or the actual Image control.

    Note: this is the default aggregation for PictureViewer.

    Returns:
    {sap.ca.ui.PictureViewerItem[]}
    getRemovable(): boolean
    Getter for property removable. Defines whether or not you can remove a picture

    Default value is false

    Returns:
    {boolean} the value of property removable
    getTileScaling(): float
    Getter for property tileScaling. Percentage of the space occupied by the image in the picture viewer control. Please note that if the factor is too close to 1, the navigation arrows usually displayed in desktop mode will not be available

    Default value is 0.95

    Returns:
    {float} the value of property tileScaling
    indexOfItem(oItem): int
    Checks for the provided sap.ca.ui.PictureViewerItem in the aggregation named items and returns its index if found or -1 otherwise.
    Parameters:
    {sap.ca.ui.PictureViewerItem}oItem the item whose index is looked for.
    Returns:
    {int} the index of the provided control in the aggregation if found, or -1 otherwise
    removeAllItems(): sap.ca.ui.PictureViewerItem[]
    Removes all the controls in the aggregation named items.
    Additionally unregisters them from the hosting UIArea.
    Returns:
    {sap.ca.ui.PictureViewerItem[]} an array of the removed elements (might be empty)
    removeItem(vItem): sap.ca.ui.PictureViewerItem
    Removes an item from the aggregation named items.
    Parameters:
    {int|string|sap.ca.ui.PictureViewerItem}vItem the item to remove or its index or id
    Returns:
    {sap.ca.ui.PictureViewerItem} the removed item or null
    selectPicture(iIndex, iIndex): sap.ca.ui.PictureViewer
    Select the picture at index iIndex from the items aggregation.
    Parameters:
    {sap.ca.ui.PictureViewerItem}iIndex the index of the picture to select; if empty, the first picture is selected
    {int}iIndex the 0-based index of the aggregation to select; for a negative value of iIndex, the picture at position 0 is selected; for a value greater than the current size of the aggregation, the selected picture at the last position is selected
    Returns:
    {sap.ca.ui.PictureViewer}this to allow method chaining
    setRemovable()
    Specify whether or not you can delete a picture. If FALSE the delete button will never be visible. Default value is TRUE
    setTileScaling(fTileScale)
    Set the percentage of the space occupied by the image in the picture viewer control. Please note that if the factor is too close to 1, the navigation arrows usually displayed in desktop mode will not be available
    Parameters:
    fTileScale
    addItem(oItem): sap.ca.ui.PictureViewer
    Adds some item oItem to the aggregation named items.
    Parameters:
    {sap.ca.ui.PictureViewerItem}oItem the item to add; if empty, nothing is inserted
    Deprecated:
    Use aggregation "tiles"
    Returns:
    {sap.ca.ui.PictureViewer}this to allow method chaining
    insertItem(oItem, iIndex): sap.ca.ui.PictureViewer
    Inserts a item into the aggregation named items. When adding a new item to the aggregation, a sap.ca.ui.PictureTile is actually created with its own ID and added to the internal TileContainer.
    Parameters:
    {sap.ca.ui.PictureViewerItem}oItem the item to insert; if empty, nothing is inserted
    {int}iIndex the 0-based index the item should be inserted at; for a negative value of iIndex, the item is inserted at position 0; for a value greater than the current size of the aggregation, the item is inserted at the last position
    Deprecated:
    Use aggregation "tiles"
    Returns:
    {sap.ca.ui.PictureViewer}this to allow method chaining