T.NQ
T.NQ

Reputation: 71

Expression Binding for Property in SAPUI5

I'm trying to set the property of a control using another control's property. In my case, I have one <sap.m.Select> and a <sap.m.Input>. The visible of <sap.m.Input> will depend on the selectedItem of the <sap.m.Select>. IMO, there is an available approach using Expression binding in XML View but I don't know how. Any suggestion?

Upvotes: 0

Views: 2002

Answers (1)

amiramw
amiramw

Reputation: 506

You can use two way binding so that both properties are binding expressions over the same property in the model.

So you can create a JSON model for example and put there a property called selectedItem. The binding of the properties should be: on select selectedItem={mymodel>selectedItem} and on input visible={parts: [{path: "mymodel>selectedItem"}], formatter: function (selectedItem) {<your manipulation>} }.

You can do that with JavaScript and with XML view. In XML view you should reference to a formatter method in the controller.

Upvotes: 1

Related Questions