on 12-17-2014 7:24 PM
hi all,
i've some very strange behavior from sap.ui.table control.
i've two different views, view1 & view2 both are search functionalists. so on search i will collect the input field values and provide them while table.bindRows("/EntitySet",null.null, filters);
view1 - has been implemented without any issues
view2 - i've some strange issue here, i receive the proper/expected response from oData service when checked in F12 (chrome). but when it renders into table.. it only shows the last row being repeated in all the rows.
lets say i get 5 rows as output response (json response seen in F12) -> the table shows 5 rows (which is correct) but it just shows/repeats the 5th (last) row for five times. not sure where the issue is.. as both the views are being coded as same in controllers. both views (xml files) are same except that the layout controller is different (one view1 is MatrixLayout, view2 is SimpleForm with ResponsiveLayout). otherwise i dont see any changes in the coding.
does anyone faced such issue before, wt is that causing this last row being repeated to the total no of rows as response? any pointers?
This sounds as if the entities that are returned through OData all have the same key.
The OData models manages its data in a map where the actual record is mapped to the key. If there is a second record with the same key, it will overwrite the data of the first record, and so on. Eventually, there might only be on distinct key, thus, the table would display only that one record.
To verify, look at the OData metadata and find out that is key of the entity that you're displaying. Then, look into the response with e.g. the Chrome DevTools and check whether the keys that are returned from the backend are unique. They probably aren't
- Max
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Max, u r awesome! its a perfect answer. appreciate your response as it worked. my key was not unique, and made new attribute uId as key+unique.
Thanks Maxi, your answerer helped me to get the resolve my issue , thankyou so much.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome answer ...i was struggling in this case but finally resolve by the help of Maximilian Lenkeit thanks maxi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 3 | |
| 3 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.