tarzanbappa
tarzanbappa

Reputation: 4978

SAPUI5 Bind Image to Object Page Header

I'm using an Object Page Layout in my SAPUI5 application and trying to bind an image through an OData url like this

/sap/opu/odata/CUSTOM/MY_SRV/ImageSet(1)/$value

And in the layout I try to bind the value like below

<uxap:ObjectPageHeader id="headerForTest" objectTitle="Object Page" showTitleSelector="false"
                                titleSelectorPress="handleTitleSelectorPress" showMarkers="false" markFavorite="false" markLocked="false" markFlagged="false"
                                markLockedPress="handleMarkLockedPress" objectImageShape="Square" objectImageURI="/sap/opu/odata/CUSTOM/MY_SRV/ImageSet(1)/$value">

But when I run the application the image not showing in the header area. The URL is correct.

And If I use an Image element it works fine.

<Image src="/sap/opu/odata/CUSTOM/MY_SRV/ImageSet(1)/$value" width="75px" height="75px" />

How to bind the Image to the Object Page Header?

Upvotes: 1

Views: 1377

Answers (1)

Jan Schulz
Jan Schulz

Reputation: 610

Set the Property isObjectIconAlwaysVisible = true.

<uxap:ObjectPageHeader id="headerForTest" objectTitle="Object Page" showTitleSelector="false"
                            titleSelectorPress="handleTitleSelectorPress" showMarkers="false" markFavorite="false" markLocked="false" markFlagged="false"
                            markLockedPress="handleMarkLockedPress" objectImageShape="Square" objectImageURI="/sap/opu/odata/CUSTOM/MY_SRV/ImageSet(1)/$value" isObjectIconAlwaysVisible="true">

Upvotes: 1

Related Questions