SAP-samples / fiori-elements-feature-showcase

Sample application that demonstrates and documents a broad variety of features of SAP Fiori elements for OData V4. Developers can play around with the new features and learn how to implement them.
https://community.sap.com/topics/fiori-elements
Apache License 2.0
185 stars 65 forks source link

Expression % instead of $ #24

Closed nocin closed 7 months ago

nocin commented 7 months ago

Hi,

here in the enabled expression binding, a % sign is used instead of $.

"enabled": "{= %{deletePossible} === true}"

In my own Fiori Elements application, I have inserted a custom column where I needed to do something similar, and I also noticed that the $ sign in an expression is not working. Is this documented somewhere ? This repo is the only place where I found this so far.

BR, Nico

schiwekM commented 7 months ago

Hi @nocin,

this documentation should explain it: https://ui5.sap.com/#/topic/daf6852a04b44d118963968a1239d2c0

Hope that helps & BR, Marten

nocin commented 7 months ago

Thanks @schiwekM!

Seems like I'm too stupid to use the search properly! Somehow I thought it was probably something Fiori Elements specific and only searched in the subchapter.

This can be undesirable or even lead to errors, for example, if OData V4 automatically adds the correct type for the “status” property which is string-like, not boolean. In such cases, use the syntax %{binding} instead. It is just a shortcut for ${path : 'binding', targetType : 'any'}.

Explains it very well!

gregorwolf commented 7 months ago

I can feel you @nocin. I ran into the same issue some time ago and it took me also half a day to find the solution.