Skip to Content
0
Former Member
Jan 26, 2014 at 11:13 PM

Data binding not working for Component based SAPUI5 app

749 Views

I may be going about this wrong but in trying to following documentation on creating SAPUI5 apps that can be added to the Fiori Launchpad, I found the UI Developer Guide that states to Run Your Own Applications in the Sandbox (delivered with SAPUI5 SDK 1.16) you should do the following:

The Fiori sandbox runs your local Fiori apps inside the Fiori launchpad. You have to create a root component for the application. The demo apps serve as reference (see for instance /test-resources/sap/ushell/ demoapp/FioriSandboxDefaultApp/Component.js).


I've done exactly that(along with the .json configuration) and I can see my app in the Local Sandbox list on the FioriLauchpad.html file when running on my Tomcat v7.0 server. Now the problem is, data binding within the application does not seem to work. I have a mock JSON that I bind the model to in a Main.view.js file using:


var oModel = new sap.ui.model.json.JSONModel();

oModel.setData({

"firstName": "Peter",

"lastName": "Pan"

});

sap.ui.getCore().setModel(oModel, "fake");

var oPage = new sap.m.Page("page", {

title: "{fake>/firstName}"

});

However the title of the Page is blank.

While in Chrome, in the Console I can see that the data is there

sap.ui.getCore().getModel("fake").getData() returns the model I set. I'm out of ideas. I will say that a typical MVC app (using a Applicaiton.js file and index.html) worked just fine. Somehow this Component based app broke it.

Is this really needed for a custom SAPUI5 app to run in the Fiori Launchpad??? Can't you just create a Tile in the Catalog and point the URL to a MVC based SAPUI5???