Four Js Development Tools Forum

General => Ask Reuben => Topic started by: Reuben B. on June 20, 2022, 06:40:29 am



Title: Ask Reuben 128 - ON FILL BUFFER
Post by: Reuben B. on June 20, 2022, 06:40:29 am
One of the key characteristics of the Dynamic User Interface and the Front-End protocol is that only the visible rows of a a static or dynamic array rendered via List Dialogs (DISPLAY ARRAY / INPUT ARRAY)  to TABLE / TREE /  SCROLLGRID views are sent from the back-end to the front-end.  That is if an array has 1,000 rows but only 20 rows are visible, only 20 rows will be sent from the back-end to the front-end.  As the user scrolls down, then additional rows are sent from the back-end to the front-end.   No resources are wasted by sending rows from the back-end to the front-end that the user cannot see.
 
That same strategy can also be applied to fetching rows from the database into the array variable.  Why use resources to fetch rows from the database table if the user is not going to look at them?  This is achieved by use of the ON FILL BUFFER block and is known as Paged Mode of a DISPLAY ARRAY.   Using the same numbers as above, if only 20 rows are visible then only 20 rows will be fetched from the database into the array variable and then sent to the front-end.

Read more at https://4js.com/ask-reuben/ig-128/