Re: Delaying child browse



If you define the child file range limit as Relationship it is not an
easy solution.

If you change the limit to a manual filter string you can control when
it gets fired. Here is an article from CMAg that talks about making
your own filters on the fly. This is an easy source code concept any
beginner can do.

http://www.clarionmag.com/cmag/v10/v10n04filters1.html

You can go one step further and make a condition to trigger the
ApplyFilter that will not update the filter string unless there is a
time lag since the last reset. Moving the child filter to the
ApplyFilter procedure (with any other filters you want) would be the
best place to rule the child file update. Adding a byte procedure
variable to the browse queue as a NOT in the View Hot field as well as
a Reset field (all browse conditions) will give you a trigger you can
cause the filter update on the child file to be when YOU want it to
fire. You just set the byte to Var = (Var +1) % 2 so it changes the
value and forces the reset when you want it to operate.

You can trap the changed parent record in ThisWindow.Reset. Then set a
flag that is monitored in a Timer Event so it does not get forgot that
you do need to refresh the child later. Without the timer the last
parent record won't trigger! The ThisWindow.reset can reset the
counter back to zero so the timer can wait until the timer expires
before flipping the reset byte on the child browse. This makes the
View engine trigger because it was defined as a reset field. In the
ApplyFilter method you then set the current time as the last time it
updated thus setting up the next waiting period. I've not found a more
reliable way to do this and control the filtering with precision.

It sounds a little more complicated than it appears but there isn't
any more code to write. Maybe less than 30 lines. Most of the magic is
inside the Hot Field and Reset field child browse property settings.
Controlling the internals of the Browse and View class externally
isn't so easy. Lots of private data and class methods. This will use
tools that you can get at without messing around with the View and
browse class internals. FWIW, this approach can migrate from Clarion
5.0 to Clarion 7 unchanged! The CMag article explains it using a QBE
application but it will work for you too.

It would better than any template could be since you have total
flexibility on the child filter. One part of the filter will include
the ChildID = ParentID expression. If you use a key to aid the range
limit side you won't slow the child browse by much other than your
imposed delay. You may want to make the delay adjustable so network
users can impose a longer delay for slower network situations. At some
point the delay would be a great help to any network user situation
since you will vastly reduce the I/O across the network.

I have not used this approach for this specific purpose but I do use
it when doing a NOTIFY between threads for almost the same reason you
would and it works well enough for that. I use it to throttle the
scrolling of a browse that updates a window on another thread. You
want to drive a second browse on the same window.

This is the best way to write dynamic filter strings and you'll find a
LOT of other uses for the technique.

On 12 Jun 2009 06:01:55 -0400, "Wolter Nijmeijer"
<wolter.nijmeijer@xxxxxxxxxxx> wrote:

Anybody has an idea what template it was or perhaps another quick and dirty
solution?
---------------------------------------
Paul Blais - Hayes, Virginia
.



Relevant Pages

  • Re: A filter driver with bus enumeration capabilities: aka serenum.
    ... Since your filter is not the power policy owner for the stack, it cannot ensure that when the child is powered up that the parent stack is also powered up....BUT...for serial that does not really matter b/c once you send the create to the serial stack from the child stack, serial will stay powered on until it has been closed. ... mark yourself as a filter, ...
    (microsoft.public.development.device.drivers)
  • Re: Still trying to clear cobwebs...
    ... Almost forgot a key detail The criteria I'd like to filter ... on is not in the child table, but in another related table that is M:1 to ... >field to bind the parent to. ...
    (comp.databases.paradox)
  • Re: Filtering and Parent-Child Relation
    ... I had one filter that on a Parent Table that the filter was depending ... on the Child of that table. ... and a child table called AccountRoutes with also 2 columns AccountID ...
    (microsoft.public.sqlserver.replication)
  • Child Aggregate Filter Not Recognising Newly Added Child Rows (ADO.NET 2.0 Dataset)
    ... reflect in any aggregate filter placed upon the parent table. ... Public Sub FillParent() ... (i.e. the filter does not recognise the new child rows). ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Typed DataSet Navigation (Multiple Tables)
    ... SINGLE DataView from the child in which contains ALL relating DataRows ... If you use a filter with the same keys as the relation, ...
    (microsoft.public.dotnet.framework.adonet)

Loading