Hello all
I am trying to send a data load from UI (SAPUI5) to the backend (xsjs).
Actually trying to use this example: Transferring complex structured data from UI to XSJS - POSTing JSON
But its not working!
Here my code:
new sap.m.Button('databutton',{ text: "send data!", press:function(){ $.post( "/services/test.xsjs", { JSON_DATA: {"Name": "Test"} } ) .done(function(data){ alert(data); }); } });
I can see the button but when I click it, nothing happens!
The backend looks like this:
var JSONString = $.request.parameters.get("JSON_DATA"); var JSONObj = JSON.parse(JSONString); $.response.status = $.net.http.OK; $.response.setBody(JSONObj.Name);
Where is the problem?
Greetings, Jan