on 04-08-2016 7:08 PM
Hello,
I try to move an icon into the Object Header control depending on an odata field. In the XML view you can set the ICON(see screenshot) but it is static. So I'm trying to find an example code how to set it based on odata field value when the form loads. Let's say something is critical so I want to display a "!" Icon.
Anyone who can tell me how to do this and has some sample code?
Thanks
Stefan
Hi Stefan,
try to bind the icon attribute using an formatter:
In Formatter Function:
formatIcon : function(sStatus){
if(sStatus === 'W'){
return "sap-icon://warning";
}
}
In XML View:
<ObjectHeader
icon="{ path: "<yourODataPath>",
formatter: "<nameSpaceForYourFormatter>.formatIcon"
}"
Regards,
Sascha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for you help Sascha.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.