Skip to Content
0
May 21, 2015 at 06:58 PM

How to check why data binding is not working

22 Views

Hi,

I have a json file in my project and would like to bind the data to some controls.

In the onInit function I am using the following code:

 onInit : function (evt) {
    // set mock model
    var sPath = jQuery.sap.getModulePath("view.Over", "./../tile_data.json");
    var oModel = new sap.ui.model.json.JSONModel(sPath);
    this.getView().setModel(oModel);
  },

My View.xml (from SAPUI5 Explored)

<mvc:View
  height="100%"
  controllerName="view.CampOver"
  xmlns:mvc="sap.ui.core.mvc"
  xmlns="sap.m">
  <Page
    showHeader="false"
    enableScrolling="false" >
    <TileContainer
      id="container"
      tileDelete="handleTileDelete"
      tiles="{/TileCollection}">
      <StandardTile
        icon="sap-icon://{icon}"
        type="{type}"
        number="{number}"
        numberUnit="{numberUnit}"
        title="{title}"
        info="{info}"
        infoState="{infoState}" />
    </TileContainer>
    <footer>
      <Toolbar>
        <ToolbarSpacer/>
          <Button text="Edit" press="handleEditPress" />
          <Button text="Busy state" press="handleBusyPress" />
        <ToolbarSpacer/>
      </Toolbar>
    </footer>
  </Page>
</mvc:View>

But when I run the app no tiles occur. I am wondering how to check if the binding is working correct and how to debug the model in order to check if it is filled correct with data?

Thank you,

Vanessa