cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Data Binding Issue between EntitySet and Entity in SAPUI5 Application

Jayakrishnan
Active Participant
0 Likes
1,620

Hi All,

We are working on SAPUI5 Application. I have a Geo Map and Detail screen. In Geo Map Screen i loaded the Collection (EntitySet). when you click the spot on the map, it show the details in the detail screen.

We implemented EntitySet and Get Entity method at the back end. we added some more fields in the Entity method. So i can show only , few details in the Map area and more info in Details screen.

But when i select the spot, i did not see the additional info on the details screen. it loads the information from my GetEntitySet view/model. I put the break point in the back end, i did not trigger.

But when i put some random values( as a key), it got triggered.

Image 1:

My Code to bind the element in the detail view is below:

var abc = "000000111743";


this.getView().getModel().metadataLoaded().then(function () {
var sObjectPath = this.getView().getModel().createKey("EntitySet", {
					Qmnum: abc
				});
	this._bindView("/" + sObjectPath);
	}.bind(this));
	_bindView: function (sObjectPath) {


			this.getView().bindElement({
				path: sObjectPath


			});
		},

Please help me on this.

Thank you,

Regards,

JK.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Likes

Hi Jayakrishnan,

Odata caches all the requests data in order to avoid the extra service calls.
You can check the cached data using " this.getModel().oData ".


In your case, when you randomly set the key parameters, it first checks in the existing cached data whether any record exists or not with the given key parameters. Since this check fails, it sends a new Odata request to the back-end and your breakpoints are getting triggered.

Why don't you write the same logic in your entityset method as well to populate the extra fields?

Regards,
Vikas

Jayakrishnan
Active Participant
0 Likes

Thank you for your comments, it is a valuable one. i will look into this