on 09-15-2017 7:24 PM
Hi Experts,
How to read specific data from the NAMED data model( here i have used V2 odata Model using XML view and MANIFEST file) once data is retrieved successfully from the backend. i am able to retrieve data using table.bindrows. This is all fine.
Now once data is available under NAMED data model, now i want to read specific records from this named data model. How to achieve this?
Thanks
Sashi
oModel = this.getView().getModel("myModel");
oModel.read("/EntitySet", {success: function(oData){
//do the required
}
});
You can call read method of odata model and after successfully reading data, the success call back function will get executed, inside this function you have the model data in the input parameter oData, which is a JavaScript object, now you can use this object to read any specific data.
Regards,
Rahul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rahul,
If i do as suggested then how can i bind the data to table. i am first retrieving the data using TABLE.BINDROWS and displaying data in table. Once this is done then i want to extract data from NAMED model.
if i first retrieve data using oModel.read, then how can i bind the data to table from success call back function?
here is the scenario:
In the first page i have 3 different radio buttons which indicates different years like 2015,2016 and 2017. When i click on first radio button(2015), then odataModel brings the 2015 related data and stores in NAMED model. When i go back and click on second radio button(2016), then odataModel brings the 2016 related data and stores 2016 ALONG WITH 2015 data in NAMED model. But i want only 2016 data to be available in the named model(not 2015 data). How to achieve this?
Thanks
sashi
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.