on 11-07-2013 11:49 AM
Hi,
I am getting list of products by using the below url.
https://sapes1.sapdevcenter.com/sap/opu/odata/sap/ZCD204_EPM_DEMO_SRV/Products?sap-ds-debug=true
When I click on selected Product I am getting the Product Detailed Information along with the Image.
Below is my code to navigate to detail page when click on selected Product.
productListTap : function(oEvent){
var oBindingContext = oEvent.getSource().getBindingContext();
var sTitle = oEvent.getSource().getTitle().split(" ").join("");
sap.ui.getCore().getEventBus().publish("nav", "to", {
viewName: "view.Product_Details",
viewId: "detail." + sTitle,
data: {
bindingContext: oBindingContext
}
});
},
Below code is to display Details
I am getting the image of the product when doing like this.
Please suggest me to get the Product Id dynamically without doing Hard code which is mentioned in box in image.
Thanks&Regards
Sridevi
Hi Sridevi Garapati,
If you take a look at the model, there is a property called ProductPicUrl:
<d:ProductPicUrl>/SAP/PUBLIC/BC/NWDEMO_MODEL/IMAGES/HT-1000.jpg</d:ProductPicUrl>
Have you tried to bind the ProductPicUrl to the Image source, just as you have done with the other properties?
new sap.m.Image({
src: {ProductPicUrl},
decorative: true,
densityAware: false
})
I hope this helps.
Kind regards
Miki von Ketelhodt
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thanks for your reply.
I changed the above code like this to get the Image from service.
new sap.m.Image({src : {
path: "ProductPicUrl",
formatter : function(fValue){
var path = "https://sapes1.sapdevcenter.com"+fValue;
return path;
}
}
})
Then It's Working fine.
Can we change the already existed image with our new image using SAPUI5 for this Service ?
Thanks&Regards
Sridevi
Hi Sridevi,
Great, glad you managed to get it to work .
I would imagine that you would not be able to change the existing image with a new one for that service, but I am not 100% sure. I think the service is just there for testing purposes (reading not writing).
Kind regards
Miki von Ketelhodt
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
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.