Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

In SAPUI5, how two add two icons in StandardListItem

I have to add two icons on a StandardListItem. Below is my XML code:

<List

            id="nameList" 

            select="selectNameList" 

            mode="{device>/listMode}" 

            noDataText="{i18n>masterListNoDataText}" 

            growing="true" 

            growingScrollToLoad="false"

            growingThreshold="{ui>/listPageSize}"

            items="{/components}">

            <items

                id="masterList">

                    <StandardListItem

                    id = "standardListItemID"

                    class="draggable_list"

                    title="{name}"

                    type="{ui>/listItemType}"

                    press="pressNameListItem"

                    icon="sap-icon://wrench"

                    iconInset="true"

                    description="{type}"

                    activeIcon="true">

                    <Image></Image>

                </StandardListItem> 

            </items>


1 Answer
SAP Expert

Instead of using StandardListitem, you should use CustomListitem. With use of CustomListitem, you can add any kind of content.

As per SAP documentation, CustomListitem has following use:

This control with a content aggregation can be used to customize standard list items that SAP doesn't provide. List mode and ListItem type are applied to CustomListItems as well.

Note: Even though the content aggregation allows any control, complex responsive layout controls (e.g. Table, Form) should not be aggregated as content.

SAP CustomListItem

new sap.m.CustomListItem(sId?, mSettings?)

Param             Type            Default Value    Description        

sId?                String                                        ID for the new control, generated automatically if no ID is given

mSettings?  Object                                        Initial settings for the new control

Advertisements

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.