Re: selected rows for a collection listbox

2018-08-05 Thread John DeSoi via 4D_Tech
I found a solution that has good performance and does not require creating thousands of objects for rows that will never be displayed. - The listbox collection is initially setup as a collection of row numbers. Using ARRAY TO COLLECTION seems to be the fastest way to do this. About 30 milliseco

Re: selected rows for a collection listbox

2018-07-30 Thread Kirk Brooks via 4D_Tech
Hey John, On Mon, Jul 30, 2018 at 7:05 PM John DeSoi via 4D_Tech <4d_tech@lists.4d.com> wrote: > The selected row numbers matter if you are not using ORDA or a fully > materialized collection of objects. I hesitant to comment directly on what you're doing because frankly you are frequently doing

Re: selected rows for a collection listbox

2018-07-30 Thread John DeSoi via 4D_Tech
Hi Kirk, Great summary, thanks for posting. > On Jul 30, 2018, at 10:27 AM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > Eventually I got the concept of manipulating the data in the collection > instead of in the listbox is the key. This is why it doesn't really matter > which r

Re: selected rows for a collection listbox

2018-07-30 Thread Kirk Brooks via 4D_Tech
I can elaborate on this a little bit - I've been working with collection based list boxes quite a bit recently. A good starting point is the blog : https://blog.4d.com/multilevel-collection-in-different-listboxes/ https://blog.4d.com/display-a-collection-in-a-listbox/ and Laurant's demo from the

Re: selected rows for a collection listbox

2018-07-30 Thread Chip Scheide via 4D_Tech
Thanks was not aware, but gathered from the continuing discussion Chip On Mon, 30 Jul 2018 13:45:35 +, Keisuke Miyako via 4D_Tech wrote: > Hi, > > v17 introduced a new (4th) kind of list box. > > the coding style is quite radical compared to conventional list boxes, > based on heavy usage of

Re: selected rows for a collection listbox

2018-07-30 Thread Kirk Brooks via 4D_Tech
Chip, In v17 you can associate a listbox with a collection or object in addition to the data sources we're accustomed to: arrays, current selection or named selection. John and Miyako are talking about about one of these new ones. On Mon, Jul 30, 2018 at 6:34 AM Chip Scheide via 4D_Tech < 4d_tech@

Re: selected rows for a collection listbox

2018-07-30 Thread Keisuke Miyako via 4D_Tech
Hi, v17 introduced a new (4th) kind of list box. the coding style is quite radical compared to conventional list boxes, based on heavy usage of "This", "Form", and member functions. 2018/07/30 22:34、Chip Scheide via 4D_Tech <4d_tech@lists.4d.com> のメール: what do you m

Re: selected rows for a collection listbox

2018-07-30 Thread Chip Scheide via 4D_Tech
John, what do you mean by a 'collection' listbox? if the listbox is from a selection then the highlighted record(s) are in the set specified by: highlight set property and the selected row(s) should be the select record number(s) if the listbox is an array then the selected item(s) are True wh

Re: selected rows for a collection listbox

2018-07-29 Thread Keisuke Miyako via 4D_Tech
to elaborate: since you already have ways to interrogate the remote PostgreSQL data source during the "On Display Detail" event, I was thinking perhaps you could add a custom "position" property to the current item during the same event for later access (I assume you only access the remote data

Re: selected rows for a collection listbox

2018-07-29 Thread Keisuke Miyako via 4D_Tech
well that's a shame... it sound like a self-imposed design restriction, I fail to see how it can deliver any substantial benefits. but I respect your decision. have you tried the "Displayed line number" function in your "On Display Detail" code? http://doc.4d.com/4Dv16/4D/16.3/Displayed-line-nu

Re: selected rows for a collection listbox

2018-07-29 Thread John DeSoi via 4D_Tech
> On Jul 29, 2018, at 9:41 PM, Keisuke Miyako via 4D_Tech > <4d_tech@lists.4d.com> wrote: > > the beauty of working with collections (in ORDA) is that > when you operate via member methods or "For each", > the elements are loaded on demand. > there is no need to work with the "On Display Detail

Re: selected rows for a collection listbox

2018-07-29 Thread Keisuke Miyako via 4D_Tech
normally with collections, you shouldn't have to care about the position of each element. it's how "For each" works and member functions such as "map" or "filter" works. "to operate on the selected rows as a collection implies that every row has to be loaded" collection data source of a list bo

Re: selected rows for a collection listbox

2018-07-29 Thread John DeSoi via 4D_Tech
It is not ORDA. I'm displaying a server side cursor from PostgreSQL. The select result may have hundreds of thousands of rows. I can scroll that nicely in 4D using On Display Detail to load only the visible data. But to operate on the selected rows as a collection implies that every row has to b

Re: selected rows for a collection listbox

2018-07-29 Thread Keisuke Miyako via 4D_Tech
a collection of objects rather than the row numbers makes this impractical. impractical how? ORDA is lazy loading by nature, so it doesn't matter if the row is visible or not. 2018/07/30 10:13、John DeSoi via 4D_Tech <4d_tech@lists.4d.com>のメール: How does the third o

Re: selected rows for a collection listbox

2018-07-29 Thread John DeSoi via 4D_Tech
How does the third one give me the *row numbers* of the highlighted rows other than sequentially searching for each item? That was my original question. I want to use a collection based list box to represent data from a remote source. I only need to load enough data to display the visible rows.

Re: selected rows for a collection listbox

2018-07-29 Thread Keisuke Miyako via 4D_Tech
there are 3 properties you can have 4D manage automatically (that is, read-only by code) current item (typically an object) current item position (typically numeric), and selected items (typically a collection) http://doc.4d.com/4Dv17/4D/17/List-box-specific-properties.300-3743666.en.html use t

selected rows for a collection listbox

2018-07-29 Thread John DeSoi via 4D_Tech
Is there a way to get all of the highlighted row numbers for a collection listbox? It seems you can only get the first highlighted row number via the currentItemPosition property. The selectedItems property would return a collection of highlighted items, but at best you would have to sequentiall