Asynchronous Interaction in a grid?

Andrew2009

Well Known Member
I have a grid in my app and users select a report in the grid and click "Create" button then it will run that report. While the report runs, it has different statuses like Waiting, Generating, Complete.

Right now, there's a refresh button and users click on it then it will get the status and update a grid column "Report Status" with one of the above statuses. Is there a way to put it maybe in a While loop and make it so it will check the status by itself when I click on the "Create" button so this "Report Status" will have different status and stop when the status is complete? All the users have to do is sit there and see the "Report Status" column changes its value

Thanks

JDE 9.2
 
Last edited:
You actually have part of the answer in your post title... Use the Asynch events to do a loop that will query the status and update a corresponding column in the grid with the status of the UBE.

I don't know how you implemented your "Create" button. AFAIK, a grid column can only be textbox, checkbox, combobox or icon. You probably did a row exit.

I would trigger the monitor for the status in the RowExit&Changed-Asynch event. Either that or in the ColumnExit&ChangedAsynch event of a column the user is likely to touch/pass over.

Of course, since it will be a loop, make sure that it has well defined exit conditions. One of those conditions must be an "EndAllLoops" condition that will stop ALL loops if set. Remember that each Asynch event is a separate thread. So each status monitor you start is a separate thread.

Once you've sorted out how to:
> start and stop the loops you are going to initiate;
> that the UBE status is actually monitored and updated;
> and that the monitoring stops when the UBE is done OR when an "EndAllLoops" is triggered.

Then, and only then, can you look at making things pretty. Pretty like making sure that the user has a perception that something is happening.

Since you're on 9.2, you can use the "SetGridCellIcon" function to show different icons based on the status of the UBE. I would recommend using an animated GIF for the waiting/processing status so that the user sees something moving on the screen even though the status hasn't changed.
 
This has been discussed before on jdelist. Unless there is something new in TR9.2 there really isn't an officially supported way to do what you are asking. What you really need is some type of client side timer control which doesn't exist. The only way to do what you are talking about is rolling your own "timer control" by embedding Javascript in a textblock control. Embedded Javascript has been discussed before on here as well. It comes with its own set of limitations and considerations.
 
Back
Top