cancel
Showing results for 
Search instead for 
Did you mean: 

Web IDE 1.17 Can't see my mock data

draschke
Active Contributor
0 Kudos

Hi,

could somebody tell me, if we can with the current version Web IDE 1.17 display the own generated (and changed) mock data or is there a bug?

At this moment I can see the json files are generated in the folder "localService". Every looks good, but if I run the app with "run the mock data", not the json files are shown.

Maybe I forgot a step.....

BR,

Dirk

Accepted Solutions (0)

Answers (2)

Answers (2)

michal_keidar
Active Contributor
0 Kudos

Hi,

Perhaps you need to change the mock data source in the project settings of your application.

Right-click your app and choose Project Settings. Then under Mock Data select JSON files as the Mock Data Source.

Regards,
Michal.

draschke
Active Contributor
0 Kudos

Hi Michal,

thanks for your help.

It is set to the json files and the json files are there as expected. This was happen automatically, after generation of mock data.

If I watch this video by hana acadamy version 1.15 there is nothing more to do.

https://youtu.be/pg4vGexo9DQ?t=114

Regarding the documentation of Web IDE there is no point that I've to change the manifest or the component files. I would expect that this happens all automatically, as I can see in this video from version 1.15.

Now I don't know should it happen automatically or do I have to do something. Or did I something wrong?

BR,

Dirk

michal_keidar
Active Contributor
0 Kudos

Hi ,

What manual steps the user should do after generation of mock data?
Should we improve our documentation of this feature?

Thanks,
Michal.

draschke
Active Contributor
0 Kudos

Hi Michal,

I would like to know, do I have to modify the app by myself (e.g. manifest or component file) after generation of the json files or should it run with the generated json files automatically?

If not, I think it should be mentioned that there are some changes / steps to do as Chantele described before.

Thanks,

Dirk

michal_keidar
Active Contributor
0 Kudos

Yes I hope can help.

Regards,
Michal.

draschke
Active Contributor
0 Kudos

Hi Michal, hi Elina,

after a short investigation I found the reason, why the generated mock data were not shown.

The resources (json-files) couldn't be found. I created a folder "mockdata" an put the json files in there.

Now it works.

(I think the path has to be changed.)

Regards,

Dirk

Thanks for your help!

Former Member
0 Kudos

Hi Dirk,

You are right. This is a bug and we fixed it in the next release of SAP Web IDE. the generated files will be generated in the mockdata folder and not in the localService.

no other changes are needed

Best regards,

Elina

draschke
Active Contributor
0 Kudos

Thank you!

Its really a very nice tool, love it.

Chantele
Active Participant
0 Kudos

Hi

can you show your manifest file and component file code please?

Regards

Chantele

draschke
Active Contributor
0 Kudos

Hi Chantele,

thanks for your help.

I changed only the path for "localUri" inside of the manifest and tried it with the patient.json file.

I'm not sure if I've to do the changings by myself, because it isn't described inside of the documentation.

Should it work on this way or did I something wrong?

BR,

Dirk

Chantele
Active Participant
0 Kudos

Hi

No problem, I had a similar problem myself a while ago.

In your manifest file under the sap.ui5 statement you can just do a config statemnt as below

"sap.ui5": {
"_version": "1.1.0",
"rootView": "sap.ui.demo.wt.view.App",

"dependencies": {
 
"minUI5Version": "1.30",
 
"libs": {
"sap.m": {}
 
}
},
"config": {
 
"patientLocal": "localService/PATIENT.json"
},


then in your Component.js file in the init() function you can declare your local service

// set invoice model - local
var oConfig = this.getMetadata().getConfig();
var sNamespace = this.getMetadata().getManifestEntry("sap.app").id;
var oPatientModel = new JSONModel(jQuery.sap.getModulePath(sNamespace, oConfig.invoiceLocal));
this.setModel(oPatientModel, "patient");


Then in your view you should be able to bind the values in your json file

"patient>/patientName" for example

If you haven't already you may need to set the metadata in your component file.

Hope that helps

draschke
Active Contributor
0 Kudos

Hi Chantele,

thank you really much!

My hope was that this happens all automatically. And I would like to know, if it should happen automatically as described within the documentation.

It would save as a lot of time.

Regards,

Dirk