on 03-23-2017 8:28 AM
Dear SAP community,
I want to display an icon in a Fiori Elements List Report. The icon should be dynamically selected by the value of a field.
What I tried to achieve this:
Writing a fixed icon uri into the IconUrl has also no effect.
I tried to use the UI annotation "IsImageURL". This works with an url to an image, but not with an icon uri (e.g. "sap-icon://error").
It could be possible to inject a new column into the sap.m.table through an extension controller, but I guess this not the aim of a list report.
Any idea how to display an icon into the list report?
Best regards
Christian Wolter
Hi,
the "solution" was extending the list report. You can inject a new column with the icon and a formatter.
Best regards
Christian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
The best solution as mentioned is to use formatters in your xml views for the ui controls.
The table can be extended by using fragments. And the behavior of ui control within the table can be controlled dynamincally using formatters. Please refer link Step 23: Custom Formatters - Best link formatters
Regards,
Anirudh HA
Hello Christian,
In order to get a picture rendered you need two things:
First, a property annotation UI.IsImageUrl for the property that comprises the URL, e.g.
<Annotations Target="STTA_PROD_MAN.STTA_C_MP_ProductType/ProductPictureURL">
<Annotation Term="UI.IsImageUrl" />
</Annotations>
Second, a UI.DataField (as a record of your LineItems) with a path pointing to the variable described before:
<Annotation Term="UI.LineItem">
...
<Record Type="UI.DataField">
<PropertyValue Property="Value" Path="ProductPictureURL"/>
<Annotation Term="UI.Importance" EnumMember="UI.ImportanceType/High"/>
</Record>
...
<Annotation>
Have fun,Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Stefan,
I tried something similiar, but this works only for a "normal" image URL (e.g. http://www.example.org/image.jpeg) but not for an icon from the UI5 Icon Explorer (e.g. "sap-icon://error").
Best regards
Christian
Hi Stefan,
Thanks for the answer.
How can we dynamically display image for each line item on a list report. I understand the annotation part of list report but, where to store image ? any hint on how to get unique url for each image ?
I have list report using Hana xsodata. In this case, how to store image on Hana DB? how to get url for each image from Hana DB?
Thanks,
Tanveer
How to use icons in List Reports is explained in Fiori elements - Status Icons and Semantic Colors
https://blogs.sap.com/2017/08/09/fiori-elements-status-icons-and-semantic-colors/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hmmm yes in that case I would have expected the URI to work as well ... i.e. sap-icon://error
I'm asking our team. I'll let you know of any response.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
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.