title: Add and edit items in sap.m.table
body: <p>I have a problem. I bind oData service to this table and it has functions (Add, Edit, Save and Cancel).</p>
  
  <p><a href="https://i.stack.imgur.com/UW4LXm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UW4LXm.png" alt="enter image description here"></a></p>
  
  <p>So I'm able to add new rows by clicking the + button, which will trigger the  <code>onAddViewTaskItem()</code> (code provided below).</p>
  
  <p><a href="https://i.stack.imgur.com/hp2oYm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hp2oYm.png" alt="enter image description here"></a></p>
  
  <p>So I input new description and sub description for the new item. However, if I edit any current items (not the new created ones), it will trigger <code>updateItems()</code> in <code>ListBase</code> object which calls <code>updateAggregation</code>.</p>
  
  <p>As I debug, it updates with the current binding contexts (which I see there only 3 items in contexts instead of 4). It seems that when I <code>addItem</code> to the table, it doesn't add the new created context to the table's binding context.</p>
  
  <p>Is there anyway to update the binding context?</p>
  
  <pre><code>onAddViewTaskItem: function(oEvent) {
      this.getModel("viewSettings").setProperty("/visible", true);
      this.getModel("viewSettings").setProperty("/editable", true);
      this._createAddRow();
    },
    _createAddRow: function() {
      var _oContext = this._createTaskItemContext();
      this._addTableRow(_oContext);
    },
    _createTaskItemContext: function(oEvent) {
      return this.getModel("xsodata").createEntry("/TaskItems", {
        properties: {
          "TaskItemID": this._generateGuid(),
          "YearID": this._oScheduleDetailDialog.getBindingContext("xsodata").getObject().YearID,
          "TaskDescription": "",
          "TaskSubDescription": "",
          "DeleteFlag": ""
        },
        success: function(oEvent) {}.bind(this),
        error: function(oEvent) {}.bind(this)
      });
    },
    _addTableRow: function(oContext) {
      var oScheduleTaskItem = this._createRowControls();
      this.getView().addDependent(oScheduleTaskItem);
      oScheduleTaskItem.setBindingContext(oContext, "xsodata");
      this.byId("tblScheduleItems").addItem(oScheduleTaskItem);
    },
    _createRowControls: function(oComboBoxControl) {
      return new ColumnListItem({
        cells: [
          this._createInputControl("viewSettings&gt;/editable", "i18n&gt;description", "xsodata&gt;TaskDescription"),
          this._createInputControl("viewSettings&gt;/editable", "i18n&gt;subDescription", "xsodata&gt;TaskSubDescription"),
          this._createCheckboxControl("viewSettings&gt;/editable", "xsodata&gt;DeleteFlag")
        ]
      });
    },
    _createInputControl: function(sEditable, sPlaceholder, sBindingProperty) {
      var _oInputControl = new Input({
        maxLength: 255,
        editable: "{" + sEditable + "}",
        placeholder: "{" + sPlaceholder + "}",
        value: "{" + sBindingProperty + "}"
      });
      return _oInputControl;
    },
    _createCheckboxControl: function(sEditable, sBindingProperty) {
      var _oCheckBoxControl = new CheckBox({
        editable: "{" + sEditable + "}",
        selected: "{= ${" + sBindingProperty + "} === 'X' ? true : false}",
        select: this.handleDeleteFlagSelect
      });
      return _oCheckBoxControl;
    },
    handleDeleteFlagSelect: function(oEvent) {
      var bSelected = oEvent.getParameter("selected");
      var sPath = oEvent.getSource().getBindingContext("xsodata").getPath();
      this.getModel("xsodata").setProperty(sPath + "/DeleteFlag", bSelected ? "X" : "");
    }, 
  </code></pre>