Skip to Content

How to update rows from user input

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)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Oct 12, 2017 at 09:53 AM

    hi,Das

    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.

    Add comment
    10|10000 characters needed 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});

      jModel.setData(aData);

      oTable.setModel(jModel);