0
votes

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?

1
There was an attempt to solve this kind of problems without using a model. But the idea seems to be abandoned.. :\ Right now, we've to use client-side models for this as explained in the answers. - Boghyon Hoffmann

1 Answers

1
votes

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.