cancel
Showing results for 
Search instead for 
Did you mean: 

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

former_member202213
Participant
0 Kudos

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...

maheshpalavalli
Active Contributor
0 Kudos

Hi Jean,

To be frank, it's very difficult to understand your question.. please take your time to rephrase your question in points..

BR,

Mahesh

Accepted Solutions (1)

Accepted Solutions (1)

former_member202213
Participant
0 Kudos

Hi Jun and Mahesh,

my question was much generally speaking and not with a specific example :

how to simply adapt a web ide project with samples from sapui5 library ?

when example is a little bit complicated I can't adapt it to my oData model.

it is the case with pdfviewer, attachment.

finally with help from friends who know javascript better than me, I succeeded in using pdfviewer, but not the attachment one.

maheshpalavalli
Active Contributor
0 Kudos

Hi Jean, true.. for some examples you can straight away use them in the webide.. but some won't work probably because they have lot of dependencies on other test resources..

Answers (1)

Answers (1)

junwu
Active Contributor
0 Kudos

don't know what you are talking.....