RHQ GUI: how to deal with user clicking to navigate to view X and then clicking to navigate to view Y before X has finished loading
Ian Springer
ian.springer at redhat.com
Mon Aug 15 14:28:20 UTC 2011
Here's an example of how fast user clicking can cause GUI code to be
executed in the wrong order thereby causing exceptions and/or unexpected
behavior. The steps listed are executed in order:
1) user clicks on Resource X in tree - browser intercepts click and
calls onClick event handler for tree node
2) getResourceComposite(X) async server call is made - control returns
to browser while waiting for async call to return
3) user clicks on Resource Y in tree - browser intercepts click and
calls onClick event handler for tree node
4) getResourceComposite(Y) async server call is made - control returns
to browser while waiting for async call to return
5) getResourceComposite(X) async server call returns and browser calls
onSuccess() handler which continues rendering X detail view
At this point we're in an inconsistent state because we've begun
rendering both the detail view for X and the detail view for Y at the
same time and both are updating the same ResourceDetailView (resource
header, tabs, etc.).
Essentially any async server calls provide windows of opportunity for
the browser to handle user clicks before GUI code is fully done drawing
the view corresponding to a prior user click.
More information about the rhq-devel
mailing list