on 07-03-2015 6:55 AM
We have a Fiori app which can display attachments. Therefore we use the function
- sap.ui.core.IconPool.getIconForMimeType(sMimeType);
This works for all of our used file types except MS Excel. For the mime type "application/vnd.ms-excel" we just get a standard icon as you can see on the attached picture. I would expect an E like the W for MS Word.
Is this normal? Is there something I can do? Should I report this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gil,
I guess you can use "excel-attachment" code to get excel icon displayed for Excel mime type. This is one of the icon provided in SAPUI5 framework.
Please have a look into icons tab in SAPUI5 developer guide or the below link directly.
Icon Explorer :- Icon Explorer
Hope this helps you.
regards,
Sabarinathan C
This isn't the solution itself but it inspires me to find the right work around.
This is my original code:
formatAttachmentIcon: function(sMimeType) {
return sap.ui.core.IconPool.getIconForMimeType(sMimeType);
},
And these are the mime types belonging to the above attached screenshot:
"MimeType": "image/bmp",
"MimeType": "application/msword",
"MimeType": "application/msword",
"MimeType": "image/gif",
"MimeType": "image/jpeg",
"MimeType": "application/pdf",
"MimeType": "image/png",
"MimeType": "application/vnd.ms-powerpoint",
"MimeType": "application/vnd.ms-powerpoint",
"MimeType": "text/plain",
"MimeType": "application/vnd.ms-excel",
"MimeType": "application/vnd.ms-excel",
This works as you can see for all types besides Excel. The method "getIconForMimeType()" delivers "sap-icon://document" for the input value "application/vnd.ms-excel". This is false.
With you hint I've changed my code in the following way.
formatAttachmentIcon: function(sMimeType) {
if ( sMimeType == "application/vnd.ms-excel") {
return "sap-icon://excel-attachment";
} else {
return sap.ui.core.IconPool.getIconForMimeType(sMimeType);
}
},
Now I get the right icon for Excel files. Not the way I like it but it works. Thank you.
BTW In my opinion this is a bug but I have no idea how I can report such issues.
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 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
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.