Skip to Content
0
May 20, 2020 at 03:26 PM

SAPUI5: How to save the Selections of a Table(Model) to the backend

279 Views Last edit May 20, 2020 at 03:29 PM 4 rev

Hello,

I do have the following Model:

function getExample(){
  	var model = {
         "Model":[0:{"Title":"First", "Option":["Yes","No","Unknown"]},
      		  1:{"Title":"Second", "Option":["Yes","No","Unknown"]},
                  2:{"Title":"Third", "Option":["Yes","No","Unknown"]}]
	}
	return model;
  }

var oModelExample = new sap.ui.model.json.JSONModel();
this.setModel(oModelExample, "modelExample")
oModelExample.setData(getExample().Model)

That is bound to the View, and delievers the following Table:

Question: Users are going to choose one of the Options :Yes/No/Unknown.

1. What it is the very best way to save the selected Option to the Backend, so that later this result can be showcased ?

2. Does .getModel() deliever Model with it selected Options ?

Attachments

table-option.png (39.6 kB)
table-option.png (39.6 kB)