I am trying to figure out how to bind a data model to a custom control. I have searched a number of similar questions here but they don't seem to match what I am trying to do. Maybe my method is wrong.
Anyway, I have created a Plunkr (https://plnkr.co/edit/UghwOObcDn1oRndOpCeJ) to demonstrate. Two input fields are created, one of which is on a custom control which extends a sap.m.Panel. I am attempting to bind the name and enabled properties to both input fields. No problem with the simple sap.m.Input on the page but the one in the custom control MyPanel no such luck. The name and enabled properties for both input fields should change when the button is pressed.
For the custom control I am trying to pass the bind properties to the value and enabled properties of the embedded input field as can be seen in App.view.xml.
If I change the following in MyPanel.js:
value: mSettings.value,
enabled: mSettings.enabled
to
value: '{/name}',
enabled: '{/editing}'
all works fine.
Any help or direction would be appreciated.
oRm.writeControlData(oControl)
in your render function. Custom setters and getters, as suggested by the answer below, aren't required to get it work. – Boghyon Hoffmann