I am transfering the head of a hierarchy of objects to the client for
them to choose which one they want to see details for.  The list
returned in this initial fetch is bound to a datagrid control, and
some of the data items are displayed in the grid.  The rest of the
data is loaded lazily through a destination via the java assembler. 
Once a request for the rest of the object is received I do return
quite a lot of data and it can take up to 2 seconds for the response
to arrive back at the client.

One immediate question is how I show a progress bar or a wait cursor
while this operation is occurring.  In all honesty I would prefer it
was synchronous but I can't seem to force that to happen.

So, I have a partially loaded object and when the remainder of the
data does finally show up I recalculate some of the fields that I am
displaying in the orginal data grid because they may be stale.  What I
have found is that I get a stack overflow where the data binding
manager is busy watching changes to the members of the class that I am
busy re-calculating.  During recalculation I get an itemPending error
which causes my recalc function to be re-called which touches the
bound data items which causes the data binding manager to kick off
again.  And round and round we go until I either run out of stack
space or the server stuff returns just in time and my data show up.

I have tried to separate out the activities so there is no binding
during loading, but this is causing me some horrible usability issues
and seems to be a bad way of approaching the problem.  What's more the
asynchronous nature of the server interaction is such that I can't
tell when exactly I'm going to receive the data (I have to rely on
trapping itemPending errors) so I don;t really know when it is safe to
re-bind.

What I would like to be able to do is just suspend the data bindings
in the client code while the lazy loading is taking place, and then
re-bind when I know I have all the data.

Any hints or architectural suggestions would be greatly appreciated.

SP

Reply via email to