You are on page 1of 1

<!DOCTYPE html> <html> <head> <title>Test UIComponent Model</title> <script src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js" id="sap-ui-bootstrap" data-sap-ui-libs="sap.

m" data-sap-ui-theme="sap_bluecrystal"> </script> </head> <body class='sapUiBody' id='content'> <script> jQuery.sap.declare("bluefin.test.Component"); sap.ui.core.UIComponent.extend("bluefin.test.Component", { createContent : function() { // Set the Model var oModel = new sap.ui.model.json.JSONModel(); oModel.setData({ "firstName": "Peter", "lastName": "Pan" }); // This call sets the model on the core // expect it to set the model on each view? sap.ui.getCore().setModel(oModel, "fake"); var oPage = new sap.m.Page("page", { title: "{fake>/firstName}" }); // This call sets the model on the view itself // uncomment to show "Peter" in the title to the right oPage.setModel(oModel, "fake"); return oPage; } }); // Create the component and add to the screen new sap.ui.core.ComponentContainer({ name: "bluefin.test" }).placeAt("content"); </script> </body> </html>

You might also like