Skip to Content

How to update rows from user input

Oct 11, 2017 at 12:06 PM


avatar image

I am inserting data into table from user input via json model but every time a new input is given the previous row data is overwritten not concatenated tab.png. Can anybody help me? Thanks!

tab.png (137.7 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

rajesh reddy Oct 12, 2017 at 09:53 AM


In Your Json model which binding u are using?(oneway binding or twoway binding).

if u are using two way binding,make it as oneway binding instead ofusing two way.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thanks for the response...

this is my code in controller:

onPress: function()

{ var oTable = this.getView().byId("tstable");

var jModel= new sap.ui.model.json.JSONModel();

//var model = this.getView().getModel("jModel");

var typ= this.getView().byId("ityp").getValue();

var hrs= this.getView().byId("ihrs").getValue();

var aData = [{ date: "", from: "", to: "", hours:"", type:"", customer: "", project: "lux", description: "" }];

aData.push({type: typ, hours: hrs});