IE8 - Clicking a link in my Flex app only opens page in a background tab
After moving from Windows XP to Windows 7 noticed this behavior in my Flex application. In IE8 when a user clicks on a link in the SWF file it uses the navigateToUrl api to open a new window pointing to an e开发者_如何转开发xternal site. This works as expected in XP on IE8 . However in Windows 7 clicking the link will open a new tab, this new tab however sits in the background therefore it is possible that it may not be noticed by the user. Also the content in this background tab does not always load fully unless you clear the cache.
Has anyone come across this issue with Flex and Windows7/IE8? In the navigateToUrl function i pass in a param of _blank.
Sound more like an IE problem to me than a Flex problem, that is unless the navigateToUrl is called on mouseDown
and not click
. Also, I would argue against the practice of opening a new tab or new window to show information. I'm also not sure what you mean that the tab 'sits in the background'.
I'm not sure if it's a problem related to the version of the operational system, couldn't go that far and investigate the root of the issue, but I found myself in a similar situation.
I had a link in a TextFlow inside a TextArea component, the TextFlow had links as elements and clicking on one of the links would open a new window as expected. The only problem was that the window wouldn't be on top and stay in the background, meaning that if the user wasn't paying attention to the task bar it was as if nothing had happened after the click.
After debugging and going into some event chains I could find out that a simple termination of the original event would do the trick... as in:
event.stopImmediatePropagation();
event.preventDefault();
Weirdly enough, the window opened and this time on top. Add this to your click event of the link component and see if it does the trick for you too.
精彩评论