cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5: One-Way and One-Time Element Binding in XML View?

tristan_storch
Explorer
0 Kudos

Hi,

since I can set the Default Binding Mode for Models, i.e. Two-Way, One-Way or One-Time, I wondered, if the Binding Mode can be set per Element Binding. I search and found, that via Expression Binding this is possible (although One-Way does not really work in my code :/):

Does work:

<Input type="Text" value="{= ${SomeProperty}}"/>

Should work, but doesn't

<Input type="Text" value="{:= ${SomeProperty}}"/>

For Expression Bindings it's obvious, that they can be at most One-Way or One-Time Bindings. But can I tell UI5 in an XML View to use One-Way or One-Time Non-Expression Element Binding in a certain spot, even though the Default Binding Mode for the corresponding Model is Two-Way (i.e. probably something like {:SomeProperty})?

- Tristan

Accepted Solutions (1)

Accepted Solutions (1)

tristan_storch
Explorer
0 Kudos

Yeah, this is awkward. As soon as I posted this I found this and I thought to myself: Why not try:

<Input type="text" value="{path: 'SomeProperty', mode: 'OneWay'}"/>, resp.

<Input type="text" value="{path: 'SomeProperty', mode: 'OneTime'}"/>?

Guess what: It worked...

Answers (0)