Hi there,
I got a Table bound to an ODATAModel.
I want to create a Button that inserts a new row to the table (and this record should not be saved to the database yet), and after that the user should enter the data to the new row and press a save button. After pressing save the record should be saved to the database.
Here's a sample what is exactly doing what I want, but it's using a JSONModle: http://jsbin.com/uxokuc/421/edit
I've came up with that, which adds a new record but also send it to the DB directly:
btnAddRecord.attachPress(function() { // tblUser.addRow(new sap.ui.table.Row()); NOT POSSIBLE var newEntry = oData.createEntry('/tbl_user', {ID: 4711, USERNAME: 'BEN'}); console.log(newEntry.getObject().USERNAME) oData.submitChanges(local); });
Some ideas here how (and if) that is possible?
Many thanks,
ben