MrDRRR
MrDRRR

Reputation: 11

Write Data from Model back into json File UI5

Is it possible to write Data from an UI5 JSON Model back into a local JSON File.

Maybe by using: new sap.ui.core.util.MockServer({....

The MockServer emulates an OData Service and there it should be possible to save Data.

Upvotes: 1

Views: 3895

Answers (1)

sirion
sirion

Reputation: 1021

Since you are working in a browser you cannot access the file system. You will have to either implement a back-end service that saves your data or you can save the data from the JSONModel in local storage.

With local storage the changed data will of course only be available in the browser where you saved it.

See for example

https://developer.mozilla.org/en/docs/Web/API/Window/localStorage https://openui5.hana.ondemand.com/#docs/api/symbols/jQuery.sap.storage.html

Upvotes: 4

Related Questions