Class sap.suite.ui.commons.ViewRepeaterModule: sap/suite/ui/commons/ViewRepeater
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.
sClassName
and enriches it with the information contained in oClassInfo
.fnFunction
to the 'changeView' event of this sap.suite.ui.commons.ViewRepeater
.fnFunction
to the 'search' event of this sap.suite.ui.commons.ViewRepeater
.fnFunction
from the 'changeView' event of this sap.suite.ui.commons.ViewRepeater
.fnFunction
from the 'search' event of this sap.suite.ui.commons.ViewRepeater
.sap.suite.ui.commons.RepeaterViewConfiguration
in the aggregation named views
and returns its index if found or -1 otherwise. 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
- itemMinWidth : int
- responsive : boolean (default: false)
- defaultViewIndex : int (default: 0)
- showSearchField : boolean (default: true)
- showViews : boolean (default: true)
- external : boolean (default: false)
- itemHeight : int
- height : sap.ui.core.CSSSize (default: '100%')
- Aggregations
- views : sap.suite.ui.commons.RepeaterViewConfiguration[]
- Associations
- externalRepresentation : string | sap.ui.core.Control
- 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.
{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.
{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. |
{sap.ui.base.Event} | oControlEvent | |
{sap.ui.base.EventProvider} | oControlEvent.getSource | |
{object} | oControlEvent.getParameters | |
{string} | oControlEvent.getParameters.query | The search query. |
sClassName
and enriches it with the information contained in oClassInfo
. oClassInfo
might contain the same kind of informations as described in Element.extend.
{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. |
{function} | the created class / constructor function |
{sap.ui.base.Metadata} | Metadata object describing this class |
oView
to the aggregation named views
. {sap.suite.ui.commons.RepeaterViewConfiguration} | oView | the view to add; if empty, nothing is inserted |
{sap.suite.ui.commons.ViewRepeater} | this to allow method chaining |
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
destroyViews(): sap.suite.ui.commons.ViewRepeater 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
getViews(): sap.suite.ui.commons.RepeaterViewConfiguration[] 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
removeAllViews(): sap.suite.ui.commons.RepeaterViewConfiguration[] 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)
removeView(vView): sap.suite.ui.commons.RepeaterViewConfiguration 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
setHeight(sHeight): sap.suite.ui.commons.ViewRepeater 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