X-CGP-ClamAV-Result: CLEAN X-VirusScanner: Niversoft's CGPClamav Helper v1.22.2a (ClamAV engine v0.102.2) X-Junk-Score: 0 [] X-KAS-Score: 0 [] Return-Path: Received: from mail01.noris.net ([62.128.1.221] verified) by post.selbstdenker.com (CommuniGate Pro SMTP 6.3.7) with ESMTPS id 27054136 for webobjects-dev@wocommunity.org; Mon, 03 Jan 2022 17:07:00 +0100 Received-SPF: none receiver=post.selbstdenker.com; client-ip=62.128.1.221; envelope-from=stefan.gaertner@nureg.de Received: from mail.nureg.de ([62.128.10.225]) by mail01.noris.net with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) (envelope-from ) id 1n4Pr6-0005B8-BT for webobjects-dev@wocommunity.org; Mon, 03 Jan 2022 17:06:40 +0100 Received: from [192.168.253.173] by mail.nureg.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1n4Pr5-00BmS0-4l for webobjects-dev@wocommunity.org; Mon, 03 Jan 2022 17:06:39 +0100 From: =?utf-8?Q?Stefan_G=C3=A4rtner?= Content-Type: multipart/alternative; boundary="Apple-Mail=_AE86D3A9-6CB6-403C-86BA-795B685A9900" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.21\)) Subject: Re: [WO-DEV] Infinite scrolling with batched reloading objects from data base? Date: Mon, 3 Jan 2022 17:06:38 +0100 References: To: WebObjects & WOnder Development In-Reply-To: Message-Id: <3011AF3A-E07D-44B6-B87A-F5D3BFC9D78F@nureg.de> X-Mailer: Apple Mail (2.3445.104.21) X-Noris-IP: 62.128.10.225 --Apple-Mail=_AE86D3A9-6CB6-403C-86BA-795B685A9900 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 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) = : >=20 > 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.=20 >=20 > Anyone done something like this? >=20 > Thanks for your ideas and help > ---markus--- >=20 >=20 > Markus Ruggiero >=20 > rucotec GmbH web https://rucotec.ch = > Steinenvorstadt 79 email markus.ruggiero@rucotec.ch = > 4051 Basel / Switzerland mobile +41 79 508 4701 >=20 >=20 >=20 >=20 >=20 >=20 >=20 >=20 -- Mit freundlichen Gr=C3=BC=C3=9Fen Stefan G=C3=A4rtner /// IT/Software-Entwicklung /// NUREG GmbH /// Dorf=C3=A4ckerstra=C3=9Fe 31 | 90427 N=C3=BCrnberg | Germany Tel.: +49-911-32002-183 | Fax: +49-911-32002-299 N=C3=BCrnberg HRB 22653 | USt.ID DE 814 685 653 Gesch=C3=A4ftsf=C3=BChrer: Michael Schmidt, Stefan Boas www.nureg.de --Apple-Mail=_AE86D3A9-6CB6-403C-86BA-795B685A9900 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 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=C3=BC=C3=9Fen

Stefan G=C3=A4rtner
/// IT/Software-Entwicklung ///

NUREG GmbH ///
Dorf=C3=A4ckerstra=C3=9Fe 31 | = 90427 N=C3=BCrnberg | Germany
Tel.: +49-911-32002-183 = | Fax: +49-911-32002-299
N=C3=BCrnberg HRB 22653 = | USt.ID DE 814 685 653
Gesch=C3=A4ftsf=C3=BChrer: = Michael Schmidt, Stefan Boas
www.nureg.de



= --Apple-Mail=_AE86D3A9-6CB6-403C-86BA-795B685A9900--