Showing results for 
Search instead for 
Did you mean: 

SAPUI5 Load src in sap.m.image from Stream/$value

0 Kudos

Hello Colleagues,

I would need some help with SAPUI5 sap.m.image and loading the image from a stream. My oData backend system is a ECC 6 EHP 8 with a service giving images from document management service by stream. I can get the data when pasting the complete URL in browser or Gateway Client. My big question is how to do this in WebIDE?
My oData looks like this:

{"d": {"results": [{"__metadata": {"id": "'0000000000000010000001429',NotificationId='630000000085')","uri": "'0000000000000010000001429',NotificationId='630000000085')","type": "WEB.LL_NOTIF_SRV_01.LLAttachmentSelection"},"DocumentNumber": "0000000000000010000001429","NotificationId": "630000000085","TaskNum": "0000","DocOrigin": "LL Test Document Type JPEG","DocType": "ZLL","DocPart": "000","DocVersion": "00","DocApplication": "JPG","DocData": "","CreatedAt": "20190401144744","CreatedBy": "XBECKERR","CreatorName": "Roman Becker","DocumentFileSize": "000000031128","Notification": "","DocumentExtension": "","DocumentCategory": "","LLStream": {"__deferred": {"uri": "'0000000000000010000001429',NotificationId='630000000085')/LLStream"}}},{"__metadata": {"id": "'0000000000000010000001430',NotificationId='630000000085')","uri": "'0000000000000010000001430',NotificationId='630000000085')","type": "WEB.LL_NOTIF_SRV_01.LLAttachmentSelection"},"DocumentNumber": "0000000000000010000001430","NotificationId": "630000000085","TaskNum": "0000","DocOrigin": "LL Test Document Type GIF","DocType": "ZLL","DocPart": "000","DocVersion": "00","DocApplication": "GIF","DocData": "","CreatedAt": "20190401145758","CreatedBy": "XBECKERR","CreatorName": "Roman Becker","DocumentFileSize": "000000001261","Notification": "","DocumentExtension": "","DocumentCategory": "","LLStream": {"__deferred": {"uri": "'0000000000000010000001430',NotificationId='630000000085')/LLStream"}}}]}}

From my understanding this must be the SRC value:'0000000000000010000001430',NotificationId='630000000085')/LLStream/$value With my basic understanding I have tried things like this to get the image shown:

<Carousel showBusyIndicator="false" id="__carousel1" pages="{LLAttachmentSelectionSet}">
<Image width="140px" height="140px" id="__image3" src="{LLStream/$value}"/>

I appreciate any help. A working example using Stream/$value would be fantastic.

Many thanks for support.

Best regards


View Entire Topic
Active Participant
0 Kudos

Hello Roman, hope you're well.

The addition of $valueis exclusive for odata properties. A feasible approach is a creation of a property on entity LLStream containing the src. Just like the example below:

Paste the url on browser to get property Picture of entity Categories
Use this url to render the image on app:
<Image src="//$value"/>