The only thing that I notice currently is that I can't ask for [Prev] when at the first record - my 'normal' method here is to simply select the 'Last' but it seems that the 'search' gets in the way - so it would be a benefit to circumvent it.
That is something you should be able to do in your various OnButtonPress / OnEditDone. Unless you have some db aware controls that directly trigger, and don't give you events.
In the Next/Prev you can
- cancel any async pending search
- decide where to go
- set a flag to prevent any search (if the event comes later / depends on order / may depend on WS)
The flag should be cleared when the data arrives.
But that means that while you wait for the result of next/prev then you can't start a search aborting next/prev.
That would only be important if next/prev could also be so slow, that a user has time to change their mind, abandon them and start a search.
For that you could schedule another async event to clear the flag.
You would then have (only some of, but in this order)
- EditDone => go async
- NextPressed => flag && exec-next && clear async && go async to clear flag
- [maybe late EditDone] => stopped by flag
- async from EditDone: do search
- async from Next: clear flag
- app goes idle (user could start a search now / if that is actually wanted?)
- data is received (alternative place to clear flag / but if something goes wrong and data is not received....)
Then again: once a db query was started (e.g. next is running), you don't want user input, until this is finished.
Because, once it has been sent to the db, the db will run it and finish it. If the user starts a 2nd action, the db will have 2 actions running (and the app only uses the last result / hopefully).
On a fast PC, the db can still finish faster running them in parallel. But on a slow PC, that may just stack up, and give the user time to schedule more and more queries.
So ideally, when you have any of the EditDone/ButtonPress you would disable all buttons, and only enable them when the result comes in.
Of course if EditDone disables the buttons, then NextPressed is encountered and cancels it, and NextPressed decides that the end is reached and no action should happen, then it must also re-enable the buttons.
Other designs would be to leave the buttons enabled, but don't send further next, while already running, collect them, and then (if avail) go forward by the total count. But that is complicated. Probably not worth it.