This content has been marked as final. Show 5 replies
First, do not bind to lastResult. *Always* use a result handler function.1 person found this helpful
In that function, you can use whatever logic you want to determine what to do or not do with the result.
Note that most data service calls retrun within milliseconds. The UI delay is caused by the rendering.
Yes I do use the result handler function but I was wondering if there is a best practice for the situation.
So here is the scenario.
A) User clicks button to view tickets. The application makes a remote call to a mid tier service. This service might take some time.
B) Before the system returns a response the user moves on and goes into a different part of the application. No longer will be viewing tickets. At this point when the response comes back it is old. User does not need it anymore and I do not want to have something pop-up to the user from another piece of the application the user is no longer in.
So I was wondering if there was a design pattern or best practice for handling application state with remote object calls.
I guess I am not following. In your handler, check the state of the UI and decide what to do or not do with the result. For example, If they have moved off the tickets view, then don't do anything with the result.1 person found this helpful
I guess that is the question then. How do I check or keep track of the state of the UI to know where the user is with in the application?
That way I can always check with in my repsonse handler to know where the user is with in the application.
I would record the users current location in the app using an instance variable on the Application. Hook updates to that var into the navigation functions you have implemented.