Subject [IBO] Re: Detail Scroll Event Called Everytime
Author Eric Handbury
--- In IBObjects@y..., Helen Borrie <helebor@t...> wrote:
> I can't imagine what use that would be but, if it matters to you,
then I'm
> missing something about your scenario. Can you explain why
scrolling the
> master without scrolling the associated detail (be it none, one or
> dependent set rows) would be useful? In a 1:1 relationship I would
> stuck if the interface management didn't treat the whole structure
as if it
> were a single record...

But sometimes there is no scrolling in the Detail dataset after a
Master scroll. Example:

Master (PK) Detail (MasterLinks KeyField)
------ ------
1 1

1) Master.First call (PK=1)
2) Master Scroll events fired
3) Detail Scroll events fired (result set contains 1 record)
4) Master.Next call (PK=2)
5) Master Scroll events fired
6) Detail Scroll events fired (result set contains 0 records)
7) Master.Next call (PK=3)
8) Master Scroll events fired
9) Detail Scroll events should NOT fire (result dataset STILL
contains 0 records, hence it has not scrolled)

In my situation, I may have 10 Detail queries all using the same
Master. If the Master scrolls (since all Master/Detail relationships
are 1:1), only 2 of the Detail queries has scrolled (1 whose key
matches the new Master key, and 1 whose key previously matched and
now is empty), and 8 queries have not scrolled. But IBO will fire all
10 Detail scroll events.
What I am saying is that the Detail Scroll events *should* be fired
only when the result dataset really does scroll, and not everytime
the Master scrolls. There is an side-effect in this, which is that
code in Scroll events is being needlessly executed. I spent the past
10 years developing switching software for telephone switches and it
was important to execute only the code that was absolutely necessary.
This was not only a performance issue, but more importantly, for
reliability. As with all software, one only has to look at the call
stack to understand the cost of all these software layers... so to
me, minimizing the code executed is important.

But like I said, this would be very difficult to implement, and I
have no real problems with how its done now. I just wanted to note it
to the group in general.