on 12-09-2013 12:58 PM
Hi ,
I am developing a sample mobile app.
In the left panel , i do item search .
If i choose an item from the result ,the description of the item should be displayed in the right panel .
Item search is working fine since it is entity set filtering.
But item desc display is not working .It is an entity read
/********* view.js *********/
var oitemDetailsPage = new sap.m.Page("itemDetails", {
title : "Item Details",
content : [ new sap.m.Label({
text : "Item Details Page"
}) ,
new sap.m.Text("itemLongText",{text : ""}) ,
]
});
/********* view.js ends*********/
/********* controller.js *********/
getItemDetails: function(itemId){
var oModel = new sap.ui.model.odata.ODataModel(serviceUrl,true);
var itemLongText = sap.ui.getCore().byId("itemLongText");
itemLongText.setModel(oModel);
itemLongText.bindText({path: "/ItemDetails(IpArticleNo='"+itemId+"',IpStoreNo='2000')", parameters:{select: "LongText"}});
}
/********* controller.js ends *********/
Am i binding the component in correct way ?
Can anyone please correct the syntax.
Or give a sample code on how to perform entity read and bind the output to sap.m component
Hi Madhumita,
You can use the oModel.read method in the oDataModel and get the description in json format and then set the Text.
ex :
fnSuccess = function(jsonstringresponse){
sap.ui.getCore().byId("itemLongText").setText(jsonstringresponse.LongText);
};
oModel.read("/ItemDetails(IpArticleNo='"+itemId+"',IpStoreNo='2000')",
null, null, true,fnSuccess,fnError);
Regards,
Pruthvi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.