Reputation: 5745
Sometimes when I want to show something and hide other thing I just do:
visible={some_variable}
for example <Column visible={some_variable}>
. Now I have to deal with Dialog
title I mean:
I would like to do something depending on other variable - if variable
is a then title="{i18n>a}"
and if variable
is b then title="{i18n>b}"
. How can I do that?
Upvotes: 0
Views: 416
Reputation: 7250
The ternary operator works in sapui5 bindings. So in this case, you could do:
<Dialog title="{= ${variable} === 'A' ? ${i18n>a} : ${i18n>b} }" />
If it gets more complicated, a formatter might be a better solution.
Upvotes: 2