cancel
Showing results for 
Search instead for 
Did you mean: 

Expression Binding in SAPUI5 for contains

former_member243729
Participant
0 Kudos

Hi,

Is there a way we can use expression binding in XML view 'contains' condition ? Like if I want to check the property whether it contains 'R' in its value.

Below is the one we generally use for equals..

"{= ${Model>/Property} === 1}"

so anything similar like do we have for contains...."{= ${Model>/Property} 'contains' 1}" ??

Accepted Solutions (1)

Accepted Solutions (1)

maheshpalavalli
Active Contributor
0 Kudos

Hi venkatasunil

You can try like below:

value = "Test" and result will be true.

          <Text text= "{= ${/value}.includes('Tes')}" />

Check the standard help, they have examples:

https://sapui5.hana.ondemand.com/#/topic/daf6852a04b44d118963968a1239d2c0.html

Thanks,
Mahesh

former_member243729
Participant
0 Kudos

Should have tried that before posting question..isn't it ? 🙂

Thanks, that worked!

Answers (1)

Answers (1)

Joseph_BERTHE
Active Contributor

hi,

Try this :

{= ${myVariable}.indexOf('R') >= 0}

Regards,

Joseph

former_member243729
Participant
0 Kudos

Thanks Joesph for the direction.