Skip to Content
0
Jan 30, 2019 at 01:13 PM

SAPUI5 adapt project from sapui5.hana.ondemand.com easily

158 Views

Hi,

I'm facing the following issue :

most of the time when I asked question about solution for my web ide project or when I searched with keyword on google, answer is the same : you may use model from sapui5.hana.ondemand.com.

yes maybe that's the way but when functionnality is a complex one such as updatecollection, or pdf viewer embedded solution,

I don't know how to adapt my project displayed as a tree with a lot of files with the model which never contains a manifest.json for example.

is there an easy way to do that ?

for example https://sapui5.hana.ondemand.com/#/entity/sap.m.PDFViewer

I tried to copy 2 out of three models, and tried to adapt them with odata path without success...

I tried to replace

var oSample1Model = new JSONModel({
				Source: sap.ui.require.toUrl("sap/m/sample/PDFViewerPopup") + "/sample1.pdf",
				//	Preview: sap.ui.require.toUrl("sap/m/sample/PDFViewerPopup") + "/sample1.jpg"
			});

with odata model :

	odataModel.read(sPath, {
				success: function (oRetrievedResult) {
					debugger;
					var oSample1Model = new JSONModel({
						Source: sap.ui.require.toUrl(gatewayUri) + oRetrievedResult.Url
					});
					oPdfViewer.setModel(oSample1Model);
					//	this.byId('image2').setModel(oSample2Model);
				}

message displayed says that metadata couldn't be loaded.

it seems natural since I didn't declare model in manifest.json since no such file exists...