on 04-02-2019 6:15 PM
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": "http://my.server.com:8018/sap/opu/odata/web/LL_NOTIF_SRV/LLAttachmentSelectionSet(DocumentNumber='0000000000000010000001429',NotificationId='630000000085')","uri": "http://my.server.com:8018/sap/opu/odata/web/LL_NOTIF_SRV/LLAttachmentSelectionSet(DocumentNumber='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": "http://my.server.com:8018/sap/opu/odata/web/LL_NOTIF_SRV/LLAttachmentSelectionSet(DocumentNumber='0000000000000010000001429',NotificationId='630000000085')/LLStream"}}},{"__metadata": {"id": "http://my.server.com:8018/sap/opu/odata/web/LL_NOTIF_SRV/LLAttachmentSelectionSet(DocumentNumber='0000000000000010000001430',NotificationId='630000000085')","uri": "http://my.server.com:8018/sap/opu/odata/web/LL_NOTIF_SRV/LLAttachmentSelectionSet(DocumentNumber='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": "http://my.server.com:8018/sap/opu/odata/web/LL_NOTIF_SRV/LLAttachmentSelectionSet(DocumentNumber='0000000000000010000001430',NotificationId='630000000085')/LLStream"}}}]}}
From my understanding this must be the SRC value: http://my.server.com:8018/sap/opu/odata/web/LL_NOTIF_SRV/LLAttachmentSelectionSet(DocumentNumber='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}">
<pages>
<Image width="140px" height="140px" id="__image3" src="{LLStream/$value}"/>
</pages>
</Carousel>
I appreciate any help. A working example using Stream/$value would be fantastic.
Many thanks for support.
Best regards
Roman
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
https://services.odata.org/V2/Northwind/Northwind.svc/Categories(1)/Picture
Use this url to render the image on app: <Image src="//services.odata.org/V2/Northwind/Northwind.svc/Categories(1)/Picture/$value"/>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
24 | |
11 | |
9 | |
7 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.