Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.ODataListBinding: Operation Mode "Client" Doesn't Consider Server-side Paging #2298

Closed
boghyon opened this issue Nov 19, 2018 · 3 comments

Comments

@boghyon
Copy link
Contributor

boghyon commented Nov 19, 2018

URL (minimal example if possible)

https://jsbin.com/tomajef/edit?js,output

Steps to reproduce the problem:

  1. Open: https://services.odata.org/V2/Northwind/Northwind.svc/Customers?$format=json
  2. See that the service didn't return all entities but appends the property "__next" for the client to get the next batch of entities.
  3. Open the minimal example. The sample has the defaultOperationMode: "Client".
  4. Observe that the list binding doesn't load this many items.

What is the expected result?

Even with the operation mode "Client", the ODataListBinding (V2 as well as V4*) checks whether there are more entities to fetch ("__next" / "@odata.nextLink").

* Currently doesn't support the "Client" operation mode.

What happens instead?

Client mode ignores server-side paging.

Any other information? (attach screenshot if possible)

Once the line defaultOperationMode: "Client" is removed, you can see that the list binding fetches more and more entities.

However, in the client operation mode, the bLengthFinal is immediately set to true without checking if there is "__next".

if (that.useClientMode()) {
// For clients mode, store all keys separately and set length to final
that.aKeys = [];
jQuery.each(oData.results, function(i, entry) {
that.aKeys[i] = that.oModel._getKey(entry);
});
that.updateExpandedList(that.aKeys);
that.aAllKeys = that.aKeys.slice();
that.iLength = that.aKeys.length;
that.bLengthFinal = true;
that.applyFilter();
that.applySort();
} else {

@IlianaB IlianaB assigned IlianaB and unassigned IlianaB Nov 19, 2018
@IlianaB
Copy link
Member

IlianaB commented Nov 19, 2018

Hello boghyon,
Thank you for sharing this finding. I've created an internal incident 1870453492. The status of the issue will be updated here in GitHub.

Regards,
Iliana

@svbender
Copy link
Contributor

svbender commented Apr 10, 2019

Hello boghyon,

The v2.ODataListBinding does not support __next links and there are no plans to support them in the near future.

The back-end needs to respond all entries at once in the client mode.

Best regards,
Sven

@ecker
Copy link
Contributor

ecker commented Jul 5, 2019

Hi boghyon, thanks for your input. As has been commented, we recommend the "server" mode for such scenarios and don't expect to enhance the "client" mode for server-side paging.

@ecker ecker closed this as completed Jul 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants