controller.js
onInit: function() {
var oModel = new sap.ui.model.json.JSONModel(jQuery.sap.getModulePath("sap.ui.demo.mock", "/products.json"));
this.getView().setModel(oModel);
},
handleButtonPress : function (evt) {
sap.m.MessageToast.show("header toolbar button pressed");
}
view.js
<core:View xmlns:core="sap.ui.core"
xmlns:mvc="sap.ui.core.mvc"
xmlns="sap.m" controllerName="view.View1"
xmlns:html="http://www.w3.org/1999/xhtml" >
<Page enableScrolling="true" title="Page Header Title" titleLevel="H2" showFooter="false">
<content>
<List items="{/ProductCollection}" >
<items>
<StandardListItem
title="{Name}"
description="{ProductId}"/>
</items>
<headerToolbar>
<Toolbar>
<Title level="H3" text="Products" />
<ToolbarSpacer />
<Button
icon="sap-icon://settings"
press="handleButtonPress" />
</Toolbar>
</headerToolbar>
</List>
</content>
</Page>
</core:View>
this example is given in demokit i didnt understand what is sap.ui.demo.mock ? And where is products .json file
when i am running this it shows error message
GET https://webidetestingnewfeatures-p1941243286trial.dispatcher.hanatrial.ondemand.com/resources/sap/ui/demo/mock/products.json 404 (Not Found)
2015-07-17 12:06:31 [preview_hidden.html] The following problem occurred: error - <html><head><title>Error report</title></head><body><h1>HTTP Status 404 - Resource not found</h1></body></html>,404,Not Found
kindly help me on this.
thanks and regards,
Abhishek lohiya