[
https://issues.apache.org/jira/browse/WICKET-5119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13627027#comment-13627027
]
Joel Hill commented on WICKET-5119:
-----------------------------------
I have been running into this issue recently as well. In my case, the link is
bringing up a PDF document. Perhaps the fact that it is not an HTML document,
some of the object data is being discarded so that repeated calls to
window.open, using the same window name, are failing.
If I override PopupSettings.getPopupJavaScript() with the following, I get an
error message of "Error: Member not found.":
return "try {" + super.getPopupJavaScript() + "} catch (err) {alert(err);}";
I have found this to be a very crude workaround, which also overrides
PopupSettings.getPopupJavaScript():
return "var win = window.open('about:blank', '" + WINDOW_NAME + "','width="+
WIDTH +",height=" + HEIGHT + "'); win.close(); " + super.getPopupJavaScript();
The big downside is the FIRST time you click the link, a temporary window pops
up and quickly closes before your actual link content appears. That is the
main reason I included width and height above, so the window mostly appears
similar to the final popup. Also WINDOW_NAME must match whatever window name
you're passing to PopupSettings. The following link talks about this issue,
and also links to another page where I got this crude workaround:
http://stackoverflow.com/questions/987572/opening-a-popup-in-ie-member-not-found
The solution provided at stackoverflow may be a better option, but could not be
accomplished with a simple override of getPopupJavaScript(). The strange thing
is this issue did not occur when I was still using wicket 1.4. I know I had to
make significant code changes when I converted to 1.5, but I have yet to see
how any of those changes would suddenly cause this bug to occur. I am still
investigating this issue on my own, now that I am narrowing in on the cause.
> PopupSettings IE8 - dosen't work secound time a link is clicked.
> ----------------------------------------------------------------
>
> Key: WICKET-5119
> URL: https://issues.apache.org/jira/browse/WICKET-5119
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 6.4.0
> Reporter: Uffe Heerfordt
> Original Estimate: 0.25h
> Remaining Estimate: 0.25h
>
> Hi,
> The popup functionality causes a script error in IE8, if the popup window is
> already open. As a result the link's default behaviour is executed instead -
> as ' return false; ' never is reached.
> Class: org.apache.wicket.markup.html.link.PopupSettings
> The problem exists in line: 188 // if(w.blur) w.focus();
> In IE8 blur and focus isen't defined - secound time a popup link is called
> and therefore the logic breaks.
> //An alternative: (test if w.blur is defined)
> script.append("'); if( jQuery.isFunction( w.blur ) && w.blur ) { w.focus(); }
> ").append(" return false;");
> Br,
> Uffe.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira