cancel
Showing results for 
Search instead for 
Did you mean: 

sap.m.GenericTile container within XML View ? Everything is marked deprecated

Attila
Active Participant

Hi Heads,

https://sapui5.hana.ondemand.com/#/api/sap.m.TileContainer/overview says:

Deprecated as of version 1.50. replaced by a container of your choice with sap.m.GenericTile instances.

Okay, but how-to embed Generic Tiles starting from 1.50 within XML views binding to a model/entityset ? Container of my choice ? How to realize/implement it? Any experience or idea, without putting additional coding within the view controlelr to use function like addContent of a kind of container ?

Thank you

Attila

Accepted Solutions (1)

Accepted Solutions (1)

junwu
Active Contributor

I did a test with jsonmodel, I think it should also work for odatamodel

<layout:HorizontalLayout allowWrapping="true" content="{myjm>/test}">

<GenericTile header="{myjm>a}" visible="true">
<tileContent>
<TileContent unit="" footer="">

</TileContent>
</tileContent>

</GenericTile>


</layout:HorizontalLayout>

var myjm=new sap.ui.model.json.JSONModel({"test":[{"a":"a"},{"a":"b"}]});

this.getView().setModel(myjm,"myjm");

image-313.png(3.1 kB)

image-313.png

Attila
Active Participant
0 Kudos

Hey Master,

I'll try it tomorrow.

Thank you

Attila
Active Participant
0 Kudos

Hi Jun,

there is always something new to learn everyday. This is true, especially in the IT Industry. The approach You sugegested is working absolutrely fine. Many thanks for your help. Now I know, I can put OData model in the content aggregation on high level without binding directly to a named aggregation of a control.

I added the tiles to a panel finally:

<Panel id="idHrmSystemsPane" busyIndicatorDelay="1000" headerText="{i18n>hrmSystems}" width="100%" height="auto" expandable="false"
    expanded="false" expandAnimation="true" backgroundDesign="Translucent" accessibleRole="Form"
    content="{path: '/Tiles', filters: [{ path : 'GroupId', operator : 'EQ', value1 : 'HRMSystems'}] }">
    <GenericTile class="sapUiResponsiveMargin tileLayout" header="{HeaderText}" subheader="{SubheaderText}" press="press"
        backgroundImage="{BackgroundImageUrl}" frameType="{path: 'FrameType', formatter: '.formatter.tileFrameType' }"
        headerImage="{HeaderImageUrl}" imageDescription="{HeaderImageDescrTtipEn}"
        mode="{path: 'GenericTileMode', formatter: '.formatter.tileContentMode' }">
        <TileContent >
            <ImageContent src="{Icon}"/>
        </TileContent>
    </GenericTile>
</Panel>

Best regards

Attila

0 Kudos

Thank you for the example, this is exactly what I was looking for!


Rgds, Mel

Answers (1)

Answers (1)

junwu
Active Contributor
0 Kudos

we just put the tile under HorizontalLayout. it works for us.

junwu
Active Contributor
0 Kudos

in our case, we just statically put a few tiles in HorizontalLayout.

Attila
Active Participant
0 Kudos

I added the tiles to sap.m.panel dynamically with some css (class="sapUiResponsiveMargin tileLayout") to keep spaces, but adding them to a content of a sap.m.Page works as well. ResponsiveFlowLayout was not working. But it would be great that sap provides an iterator/ an appropriate tile container starting from 1.50 to use it on a declarative manner within XML views using aggregation binding.

Attila
Active Participant
0 Kudos

I have customizing in backend exposed through an OData service to deliver the tiles displayed, so definition on static manner is not applicable in my case. Thanks