All,
I just started a Feature Request for this:
http://forums.4d.com/Post//29409213/1/

Take a look and see what you think. Collection/entity based listboxes are a
very different animal from array or selection based ones. And the way to
work with them is different too. Frankly the easiest thing would be if we
could set the selected collection and the listbox would highlight the rows
corresponding to those elements.

I'm proposing a command where you pass a collection of indices (scalar, the
index values of the objects you want) or a collection of elements contained
in the listbox collection. This second form is what you get with
collection.query.

On Tue, Apr 16, 2019 at 8:45 AM Douglas von Roeder via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Keith:
>
> How about this - rather than change the highlight, what about just changing
> the color of the rows to mimic that they’re selected? You can still
> maintain array of record numbers/ID’s that represent the selection but just
> update the UI so that it looks like the rows are selected.
>
> My thinking is that by using the list box code to select the rows, that’s
> causing 4D to reload the records. The thought "Why would you want to do
> that (if you don’t have to)?”, comes to mind. :-)
>
> --
> Douglas von Roeder
> 949-336-2902
>
>
> On Tue, Apr 16, 2019 at 7:22 AM Keith Culotta via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
>
> > Justin,
> >
> > Thank you for the suggestion.
> >
> > I switched the deselect-all code to
> >    LISTBOX SELECT ROW(*;"valsBox";1;lk replace selection)
> >    LISTBOX SELECT ROW(*;"valsBox";1;lk remove from selection)
> > and the selection did clear, however as soon as this add-to-selection
> code
> > is executed
> >    LISTBOX SELECT ROW(*;"valsBox";0;lk replace selection)
> > 4D immediately crashes.
> >
> > If all 40k rows get deselected, using either method, and selecting them
> > all again is done in a loop, the loop finishes in about two seconds.
> > At that point the macOS spinning wheel appears for three minutes. The
> > highlight then appears and control is returned to the app.
> > The fewer the records being highlighted, the shorter the macOS wheel
> spins.
> >
> > Regards,
> > Keith - CDI
> >
> > > On Apr 15, 2019, at 7:50 PM, Justin Carr via 4D_Tech <
> > 4d_tech@lists.4d.com> wrote:
> > >
> > > On 16 Apr 2019, at 5:04 am, Keith Culotta via 4D_Tech <
> > 4d_tech@lists.4d.com> wrote:
> > >>
> > >> Hello,
> > >>
> > >> I'm looking for a fast way to highlight a selection of rows in an
> > entity selection listbox.  The way I am aware of works OK unless the
> > listbox gets a large number of rows.
> > >>
> > >> Adding records to the Selected Items name in the Property list does
> not
> > highlight the listbox contents.  The equivalent of adding records to the
> > "UserSet" is not available with entity selection listboxes.
> > >>
> > >> Highlighting all with LISTBOX SELECT ROW(*;"listBox";0;lk add to
> > selection) crashes 4D if the listbox contains enough records.
> > >> LISTBOX SELECT ROW(*;"listBox";$position;lk add to selection) crashes
> > if put in a fast FOR loop.  If the loop is executed more slowly there is
> > success.  The slowness comes from looking for entitySelected[i] within
> the
> > entity selection and highlighting its position in the listbox.
> > >>
> > >> Is there a better way to get there?
> > >
> > > Hey Keith
> > >
> > > Are you clearing the listbox selection first (with LISTBOX SELECT
> > ROW(*;"listBox";0;lk remove from selection)? If so, that is probably the
> > cause of the crashing you are seeing. You can workaround it by
> highlighting
> > and unhighlighting the first row instead, i.e.
> > >
> > > LISTBOX SELECT ROW(*;"listBox";1;lk replace selection)
> > > LISTBOX SELECT ROW(*;"listBox";1;lk remove from selection)
> > >
> > > cheers
> > > Justin
> >
> > **********************************************************************
> > 4D Internet Users Group (4D iNUG)
> > Archive:  http://lists.4d.com/archives.html
> > Options: https://lists.4d.com/mailman/options/4d_tech
> > Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> > **********************************************************************
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **********************************************************************



-- 
Kirk Brooks
San Francisco, CA
=======================

What can be said, can be said clearly,
and what you can’t say, you should shut up about

*Wittgenstein and the Computer *
**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to