Mailing List webobjects-dev@wocommunity.org Message #353
From: Stefan Gärtner <stefan.gaertner@nureg.de>
Subject: Re: [WO-DEV] Infinite scrolling with batched reloading objects from data base?
Date: Mon, 3 Jan 2022 17:06:38 +0100
To: WebObjects & WOnder Development <webobjects-dev@wocommunity.org>
Hello Markus,

ERXBatchingDisplayGroup does what you need. It is an extension of ERXDisplayGroup with paging.
Just create an instance, call setNumberOfObjectsPerBatch and then use it like any other ERXDisplayGroup.
Just make sure to always apply a sorting to get consistent paging results. I usually apply the sorting chosen by the user and then additionally sort by database id, for the case that the former has duplicate values.
Under the hood ERXBatchingDisplayGroup will first fetch the PKs using SQL LIMIT and OFFSET. Then the actually objects of the current page are fetched using the PKs.

Concerning components, I have no experience with ERXBatchNavigationBar, but I am using a custom extension of ERXFlickrBatchNavigation and it works like a charm.

You might also want to take a look at ERXBatchFetchUtilities and ERXFetchSpecificationBatchIterator for advanced use cases.

Best regards,
Stefan



Am 29.12.2021 um 17:27 schrieb Markus Ruggiero (rucotec) <markus.ruggiero@rucotec.ch>:

I have a require to do batched reloading or more and more objects from the database when the user scrolls. Something like on Google search results page where you either can hit a button or even just the next 50 or so hits are added dynamically. Does Wonder have something (maybe Ajaxy) that does this? I have a vague recollection that ERXBatchNavigationBar (?) is the only element that can do batched reads against the database. 

Anyone done something like this?

Thanks for your ideas and help
---markus---


Markus Ruggiero

rucotec GmbH                        web https://rucotec.ch
Steinenvorstadt 79                email markus.ruggiero@rucotec.ch
4051 Basel / Switzerland         mobile +41 79 508 4701











--
Mit freundlichen Grüßen

Stefan Gärtner
/// IT/Software-Entwicklung ///

NUREG GmbH ///
Dorfäckerstraße 31 | 90427 Nürnberg | Germany
Tel.: +49-911-32002-183 | Fax: +49-911-32002-299
Nürnberg HRB 22653 | USt.ID DE 814 685 653
Geschäftsführer: Michael Schmidt, Stefan Boas
www.nureg.de



Subscribe (FEED) Subscribe (DIGEST) Subscribe (INDEX) Unsubscribe Mail to Listmaster