Monday, April 30, 2007

DWR's loading message may result in event "lost" in Firefox

When those 'edit' links in manage users/groups/roles are clicked, two events are actually triggered, 1st one is onmousedown event to select table rows (a DWR server call), 2nd one is onclick event to display the dialog (local). Then when we have DWRUtil.useLoadingMessage in page's init() to display loading message. In FireFox, the 2nd onclick event is not captured if the user release the mouse during the message display period. (this is very obvious in QA server, it take a little bit longer to return the DWR call; in our local dev server, it run so fast so almost never happen.) This is because when displaying such loading message, Firebox blocks UI. The release of the mouse is ignored during that block time, thus onclick event isn't triggered. IE doesn't have this problem though.

Note: onmousedown does not garantee that an onclick event will occur on the same target. For example, if you mouse over a link and then press and hold the click button, but then you move off of that link and release the button, the link will not be clicked.

No comments: