0

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?

Michu93
  • 5,058
  • 7
  • 47
  • 80

1 Answers1

2

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.

Jorg
  • 7,219
  • 3
  • 44
  • 65