Skip to Content
avatar image
-1
Former Member

SAPUI5: Get modified values from UI. The concept was driven using oData

Currently i was doing SAPUI5 a self study. I used SAPUI5 Explored as reference and replicate the functionality in HanahStudio using the mockdata. But, there was an issue encountered when implementing it using ODATA in edit mode. I can not get the modified data in the UI table as the front end system will always triggered the back end and repopulate everything.

Failed steps:

(a) I also do the debugging to check if the modification has been carry over to back end and there were none.

(b) Check also the values before and after triggering the back end. The result was getting the old data.

CODING MADE IN HANAH STUDIO

CONTROLLER

INITIALIZATION FUNCTION:
this.oModel = new sap.ui.model.odata.ODataModel(url);	
this.getView().setModel(this.oModel);
this.oTable = this.getView().byId("idProductsTable");
 

ONSAVE FUNCTION

* CHECK table value before triggering the ODAta
RESULT Still i can not get the modified data.
var oTable = this.getView().byId("idProductsTable");
var	aModel = oTable.getModel();
var oData = aModel.oData;
console.log(oData);

*TRIGGERING THE BACK END
this.rebindTable(this.oReadOnlyTemplate, "Navigation");

VIEW

<Table id="idProductsTable" growing="true" growingThreshold="10" mode="MultiSelect">

Questions

1. How can we retrieve the changes in the UI table? Any suggestion and recommendation on how to retrieved the modified data.

Thank you in advance.

sapui5-issue.png (178.7 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Dec 05, 2017 at 07:00 AM

    Hi Choco Relacion,

    Could you refresh your model data after your update function has been executed in your back end OData. Use the foll. code :

    your_model_object.refresh(true);

    Hope this helps,

    Regards,

    Soumya M

    Add comment
    10|10000 characters needed characters exceeded