I would like to display a sap.m.Button in case the value of two model properties are equal. It that possible via expression binding.
Bindings:
{user-management>/alias}- value:
"TESTUSER"
- value:
{recipe-service>Author/alias}- value:
"TESTUSER"
- value:
My attempts:
<Button xmlns="sap.m" visible="{= ${user-management>/alias} === ${recipe-service>Author/alias}}" />
<!-- or: -->
<Button xmlns="sap.m" visible="{= ${user-management>/alias} === ${recipe-service>Author/alias} ? true : false}"/>
The above attempts are not working resulting with the following console error:
FormatException in property 'visible' of 'Element sap.m.Button#__button1': TESTUSER is not a valid boolean value Hint: single properties referenced in composite bindings and within binding expressions are automatically converted into the type of the bound control property, unless a different 'targetType' is specified. targetType:'any' may avoid the conversion and lead to the expected behavior.
I am not aware of using targetType for expression binding.