on 2023 Sep 14 12:42 PM
Hello,
I have got an Fiori Elements App based on a Worklist and ObjectPage. I have added some custom Function based on this documentation: Enabling Actions Added Using Extension Points - Documentation - Demo Kit - SAPUI5 SDK (ondemand.com)
This is working as expected. But now I try to add an Icon to the generated Button. Is there any way to achive this? Maybe like:
"MyAction": {"id": "myActionButton","text": "{i18n>myTest}","press": "onActionOne","requiresSelection": true,
"icon": "sap-icon://duplicate"},
I'am on a S/4 2022 with SAPUI5 1.108
Thank you for any hint.
ps: I know I would be possible with some hook (onBeforeRendering) or so, but it doesnt feels right 😉
Request clarification before answering.
Hello,
To add an icon to your action button in the controller, you can follow this approach:
let moveDownBtnId = this.getView().byId("<pass the button id here>");
const sIconURI_seqDown = IconPool.getIconURI("sap-icon://navigation-down-arrow");
moveDownBtnId.setIcon(sIconURI_seqDown);
This allows you to dynamically set an icon for your action button. You can replace the "sap-icon://navigation-down-arrow" with any other icon URI that suits your needs.
This method should work without needing to hook into 'onBeforeRendering', and it aligns with your use case in S/4 2022 with SAPUI5 1.108.
Hope this helps!
Regards,
Ananya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
30 | |
21 | |
16 | |
8 | |
7 | |
6 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.