Easy Peasy Top of the List

You can give this a try. I wrote it more than 23 years ago :slight_smile:

Used it quite a bit back when I used appgen.

jsbrowsec55.zip (2.2 KB)

Here’s the readme:

Real Parent/Child Listboxes for ABC.

Currently in ABC, there is no built-in way to relate a
particular “Parent” browse with its “Child” browse(s).
When a parent browse is scrolled, the child browse does
change the displayed records, but instead of resetting
selector bar to the top, it tries to find the “closest”
to the previously selected record. This behavior often
might be desirable in some cases, but when it is a child
browse, it should be re-set (in my opinion).

This enclosed derivation of the ABC BrowseClass class
allows a parent browse to keep track of it’s children
so that they can be properly reset upon the scrolling
of the parent browse. It also handles the enabling/disabling
of the child browse’s INSERT button if there are no records
in the parent browse.

!Installation-------------------------------------------

  1. Copy JSbrowse.inc and JSBrowse.clw to the libsrc directory. (in C7+, use \Clarion\Accessory\Libsrc\win)
  2. Refresh the ABC headers or close/restart CW.

!Implementation-----------------------------------------

  1. For a “PARENT” browse, uncheck “Use Default ABC Browse” in the
    browse class properties, and set the class to “JSBrowseClass”

  2. In the embeditor, after the browses initialize, put this:

YourParentBrowse.AddItem(AChildBrowse)
YourParentBrowse.AddItem(AnotherChildBrowseIfYouHaveOne,0)!Pass a zero like this if you don’t want the child browse to be disabled if there are no records in the parent browse.
YourParentBrowse.AddItem(YetAnotherChildBrowseIfYouHaveOne)
!Add more if you need

!That’s It-----------------------------------------------

  1. Compile and go.
6 Likes