Created
July 17, 2015 14:00
-
-
Save ikiw/840b56c86b8bb7a4faa0 to your computer and use it in GitHub Desktop.
Object bindings in ui5 control
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html><head> | |
| <meta http-equiv='X-UA-Compatible' content='IE=edge' /> | |
| <meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/> | |
| <title>test</title> | |
| <script id='sap-ui-bootstrap' type='text/javascript' | |
| src='/sapui5/resources/sap-ui-core.js' | |
| data-sap-ui-theme='sap_bluecrystal' | |
| data-sap-ui-libs='sap.m' | |
| data-sap-ui-bindingSyntax='complex'></script> | |
| <!-- add 'sap.ui.table' and/or other libraries if required --> | |
| <script> | |
| var oModel = new sap.ui.model.odata.v2.ODataModel( | |
| "/uilib-sample/proxy/http/services.odata.org/Northwind/Northwind.svc/", | |
| { | |
| json: true, | |
| loadMetadataAsync: true | |
| } | |
| ); | |
| var i = new sap.m.Input({ | |
| models: oModel, | |
| objectBindings: { | |
| undefined: { | |
| path: "/Employees(2)", | |
| events: { | |
| dataReceived: function() { | |
| alert("Data received"); | |
| oModel.setProperty("/Employees(2)/LastName", "Test"); | |
| } | |
| } | |
| } | |
| }, | |
| value: "{LastName}" | |
| }).placeAt( "content" ); | |
| </script> | |
| </head> | |
| <body class='sapUiBody'> | |
| <div id='content'></div> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment