Class sap.suite.ui.commons.ViewRepeaterModule: sap/suite/ui/commons/ViewRepeater

extends RowRepeater

This control extends the sap.ui.commons.RowRepeater control providing an ability to change data representation by switching between a number of views. The data can be displayed not only in rows but also in tiles that are adjusted to fill the entire horizontal space in a row.

Deprecated API:Since version 1.32. Deprecated. Standard Fiori technology should be used.

Constructor Summary
new sap.suite.ui.commons.ViewRepeater(sId?, mSettings?)Constructor for a new ViewRepeater.
Event Summary
changeView(oControlEvent)This event is fired when a user switches between views.
search(oControlEvent)This event is fired when the user performs a search.
Events borrowed from class sap.ui.commons.RowRepeater
Events borrowed from class sap.ui.core.Control
Method Summary
sap.suite.ui.commons.ViewRepeater.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.suite.ui.commons.ViewRepeater with name sClassName and enriches it with the information contained in oClassInfo.
sap.suite.ui.commons.ViewRepeater.getMetadata()Returns a metadata object for class sap.suite.ui.commons.ViewRepeater.
addView(oView)Adds some view oView to the aggregation named views.
attachChangeView(oData?, fnFunction, oListener?)Attach event handler fnFunction to the 'changeView' event of this sap.suite.ui.commons.ViewRepeater.
attachSearch(oData?, fnFunction, oListener?)Attach event handler fnFunction to the 'search' event of this sap.suite.ui.commons.ViewRepeater.
destroyViews()Destroys all the views in the aggregation named views.
detachChangeView(fnFunction, oListener)Detach event handler fnFunction from the 'changeView' event of this sap.suite.ui.commons.ViewRepeater.
detachSearch(fnFunction, oListener)Detach event handler fnFunction from the 'search' event of this sap.suite.ui.commons.ViewRepeater.
fireChangeView(mArguments?)Fire event changeView to attached listeners.
fireSearch(mArguments?)Fire event search to attached listeners.
getDefaultViewIndex()Getter for property defaultViewIndex.
getExternal()Getter for property external.
getExternalRepresentation()The control to be rendered instead of the repeater's own content.
getHeight()Getter for property height.
getItemHeight()Getter for property itemHeight.
getItemMinWidth()Getter for property itemMinWidth.
getResponsive()Getter for property responsive.
getShowSearchField()Getter for property showSearchField.
getShowViews()Getter for property showViews.
getViews()Getter for aggregation views.
indexOfView(oView)Checks for the provided sap.suite.ui.commons.RepeaterViewConfiguration in the aggregation named views and returns its index if found or -1 otherwise.
insertView(oView, iIndex)Inserts a view into the aggregation named views.
removeAllViews()Removes all the controls in the aggregation named views.
removeView(vView)Removes an view from the aggregation named views.
setDefaultViewIndex(iDefaultViewIndex)Setter for property defaultViewIndex.
setExternal(bExternal)Setter for property external.
setExternalRepresentation(vExternalRepresentation)The control to be rendered instead of the repeater's own content.
setHeight(sHeight)Setter for property height.
setItemHeight(iItemHeight)Setter for property itemHeight.
setItemMinWidth(iItemMinWidth)Setter for property itemMinWidth.
setResponsive(bResponsive)Setter for property responsive.
setShowSearchField(bShowSearchField)Setter for property showSearchField.
setShowViews(bShowViews)Setter for property showViews.
Constructor Detail
new sap.suite.ui.commons.ViewRepeater(sId?, mSettings?)
Constructor for a new ViewRepeater.

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
    • views : sap.suite.ui.commons.RepeaterViewConfiguration[]
  • Associations
  • Events
    • search : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
    • changeView : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]

In addition, all settings applicable to the base type sap.ui.commons.RowRepeater 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.32. Deprecated. Standard Fiori technology should be used.
Event Detail
changeView(oControlEvent)
This event is fired when a user switches between views.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{int}oControlEvent.getParameters.oldViewIndex Contains an index of the previous view in the Views aggregation.
{int}oControlEvent.getParameters.newViewIndex Contains an index of the new view in the Views aggregation.
{string}oControlEvent.getParameters.filterId Contains an ID of the filter in the Filters aggregation.
{string}oControlEvent.getParameters.sorterId Contains an ID of the sorter in the Sorters aggregation.
{int}oControlEvent.getParameters.page Contains a page number.
search(oControlEvent)
This event is fired when the user performs a search.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{string}oControlEvent.getParameters.query The search query.
Method Detail
sap.suite.ui.commons.ViewRepeater.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.suite.ui.commons.ViewRepeater 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.suite.ui.commons.ViewRepeater.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.suite.ui.commons.ViewRepeater.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
Adds some view oView to the aggregation named views.
Parameters:
{sap.suite.ui.commons.RepeaterViewConfiguration}oView the view to add; if empty, nothing is inserted
Returns:
{sap.suite.ui.commons.ViewRepeater}this to allow method chaining
attachChangeView(oData?, fnFunction, oListener?): sap.suite.ui.commons.ViewRepeater
Attach event handler fnFunction to the 'changeView' event of this sap.suite.ui.commons.ViewRepeater.
. When called, the context of the event handler (its this) will be bound to oListener if specified otherwise to this sap.suite.ui.commons.ViewRepeater.
itself.

This event is fired when a user switches between views.

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.suite.ui.commons.ViewRepeater.
itself.
Returns:
{sap.suite.ui.commons.ViewRepeater}this to allow method chaining
attachSearch(oData?, fnFunction, oListener?): sap.suite.ui.commons.ViewRepeater
Attach event handler fnFunction to the 'search' event of this sap.suite.ui.commons.ViewRepeater.
. When called, the context of the event handler (its this) will be bound to oListener if specified otherwise to this sap.suite.ui.commons.ViewRepeater.
itself.

This event is fired when the user performs a search.

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.suite.ui.commons.ViewRepeater.
itself.
Returns:
{sap.suite.ui.commons.ViewRepeater}this to allow method chaining
Destroys all the views in the aggregation named views.
Returns:
{sap.suite.ui.commons.ViewRepeater}this to allow method chaining
detachChangeView(fnFunction, oListener): sap.suite.ui.commons.ViewRepeater
Detach event handler fnFunction from the 'changeView' event of this sap.suite.ui.commons.ViewRepeater.

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.suite.ui.commons.ViewRepeater}this to allow method chaining
detachSearch(fnFunction, oListener): sap.suite.ui.commons.ViewRepeater
Detach event handler fnFunction from the 'search' event of this sap.suite.ui.commons.ViewRepeater.

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.suite.ui.commons.ViewRepeater}this to allow method chaining
fireChangeView(mArguments?): sap.suite.ui.commons.ViewRepeater
Fire event changeView to attached listeners.

Expects following event parameters:

  • 'oldViewIndex' of type int Contains an index of the previous view in the Views aggregation.
  • 'newViewIndex' of type int Contains an index of the new view in the Views aggregation.
  • 'filterId' of type string Contains an ID of the filter in the Filters aggregation.
  • 'sorterId' of type string Contains an ID of the sorter in the Sorters aggregation.
  • 'page' of type int Contains a page number.
Parameters:
{Map}mArguments? the arguments to pass along with the event.
Returns:
{sap.suite.ui.commons.ViewRepeater}this to allow method chaining
fireSearch(mArguments?): sap.suite.ui.commons.ViewRepeater
Fire event search to attached listeners.

Expects following event parameters:

  • 'query' of type string The search query.
Parameters:
{Map}mArguments? the arguments to pass along with the event.
Returns:
{sap.suite.ui.commons.ViewRepeater}this to allow method chaining
getDefaultViewIndex(): int
Getter for property defaultViewIndex. The index of the default view starting from 0. The view is selected on the initial rendering of the control. If the index is greater than the total quantity of the views, the last view is selected.

Default value is 0

Returns:
{int} the value of property defaultViewIndex
getExternal(): boolean
Getter for property external. Indicates if the external representation of the current view is rendered.

Default value is false

Returns:
{boolean} the value of property external
getExternalRepresentation(): string
The control to be rendered instead of the repeater's own content.
Returns:
{string} Id of the element which is the current target of the externalRepresentation association, or null
getHeight(): sap.ui.core.CSSSize
Getter for property height. The height of the control. Only applicable if the responsive property is set to true.

Default value is 100%

Returns:
{sap.ui.core.CSSSize} the value of property height
getItemHeight(): int
Getter for property itemHeight. The height of the tile in the current view in pixels. Only applicable if the responsive property is set to true. This value is used for calculating the number of tile rows.

Default value is empty/undefined

Returns:
{int} the value of property itemHeight
getItemMinWidth(): int
Getter for property itemMinWidth. The minimal width of the tile for the current view. Only applicable if "responsive" property is set to true.

Default value is empty/undefined

Returns:
{int} the value of property itemMinWidth
getResponsive(): boolean
Getter for property responsive. This parameter indicates whether the content is shown in rows or tiles. If false, the content is shown in rows just like in core sap.ui.commons.RowRepeater. If true, the content is shown in tiles (similar to sap.ui.ux3.DataSet control) that have minimal width defined by the "itemMinWidth" property. The number of columns depends on the parent control's width. If you resize the control, the number of columns may change respectively so that the content tiles can fill the entire space of a row.

Default value is false

Returns:
{boolean} the value of property responsive
getShowSearchField(): boolean
Getter for property showSearchField. Indicates if the search field panel is shown.

Default value is true

Returns:
{boolean} the value of property showSearchField
getShowViews(): boolean
Getter for property showViews. Indicates if the view selector panel is shown.

Default value is true

Returns:
{boolean} the value of property showViews
Getter for aggregation views.
The list of views for the data representation.
Returns:
{sap.suite.ui.commons.RepeaterViewConfiguration[]}
indexOfView(oView): int
Checks for the provided sap.suite.ui.commons.RepeaterViewConfiguration in the aggregation named views and returns its index if found or -1 otherwise.
Parameters:
{sap.suite.ui.commons.RepeaterViewConfiguration}oView the view whose index is looked for.
Returns:
{int} the index of the provided control in the aggregation if found, or -1 otherwise
insertView(oView, iIndex): sap.suite.ui.commons.ViewRepeater
Inserts a view into the aggregation named views.
Parameters:
{sap.suite.ui.commons.RepeaterViewConfiguration}oView the view to insert; if empty, nothing is inserted
{int}iIndex the 0-based index the view should be inserted at; for a negative value of iIndex, the view is inserted at position 0; for a value greater than the current size of the aggregation, the view is inserted at the last position
Returns:
{sap.suite.ui.commons.ViewRepeater}this to allow method chaining
Removes all the controls in the aggregation named views.
Additionally unregisters them from the hosting UIArea.
Returns:
{sap.suite.ui.commons.RepeaterViewConfiguration[]} an array of the removed elements (might be empty)
Removes an view from the aggregation named views.
Parameters:
{int|string|sap.suite.ui.commons.RepeaterViewConfiguration}vView the view to remove or its index or id
Returns:
{sap.suite.ui.commons.RepeaterViewConfiguration} the removed view or null
setDefaultViewIndex(iDefaultViewIndex): sap.suite.ui.commons.ViewRepeater
Setter for property defaultViewIndex.

Default value is 0

Parameters:
{int}iDefaultViewIndex new value for property defaultViewIndex
Returns:
{sap.suite.ui.commons.ViewRepeater}this to allow method chaining
setExternal(bExternal): sap.suite.ui.commons.ViewRepeater
Setter for property external.

Default value is false

Parameters:
{boolean}bExternal new value for property external
Returns:
{sap.suite.ui.commons.ViewRepeater}this to allow method chaining
setExternalRepresentation(vExternalRepresentation): sap.suite.ui.commons.ViewRepeater
The control to be rendered instead of the repeater's own content.
Parameters:
{string|sap.ui.core.Control}vExternalRepresentation Id of an element which becomes the new target of this externalRepresentation association. Alternatively, an element instance may be given.
Returns:
{sap.suite.ui.commons.ViewRepeater}this to allow method chaining
Setter for property height.

Default value is 100%

Parameters:
{sap.ui.core.CSSSize}sHeight new value for property height
Returns:
{sap.suite.ui.commons.ViewRepeater}this to allow method chaining
setItemHeight(iItemHeight): sap.suite.ui.commons.ViewRepeater
Setter for property itemHeight.

Default value is empty/undefined

Parameters:
{int}iItemHeight new value for property itemHeight
Returns:
{sap.suite.ui.commons.ViewRepeater}this to allow method chaining
setItemMinWidth(iItemMinWidth): sap.suite.ui.commons.ViewRepeater
Setter for property itemMinWidth.

Default value is empty/undefined

Parameters:
{int}iItemMinWidth new value for property itemMinWidth
Returns:
{sap.suite.ui.commons.ViewRepeater}this to allow method chaining
setResponsive(bResponsive): sap.suite.ui.commons.ViewRepeater
Setter for property responsive.

Default value is false

Parameters:
{boolean}bResponsive new value for property responsive
Returns:
{sap.suite.ui.commons.ViewRepeater}this to allow method chaining
setShowSearchField(bShowSearchField): sap.suite.ui.commons.ViewRepeater
Setter for property showSearchField.

Default value is true

Parameters:
{boolean}bShowSearchField new value for property showSearchField
Returns:
{sap.suite.ui.commons.ViewRepeater}this to allow method chaining
setShowViews(bShowViews): sap.suite.ui.commons.ViewRepeater
Setter for property showViews.

Default value is true

Parameters:
{boolean}bShowViews new value for property showViews
Returns:
{sap.suite.ui.commons.ViewRepeater}this to allow method chaining