[
https://issues.apache.org/jira/browse/WICKET-5119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13637985#comment-13637985
]
Martin Grigorov commented on WICKET-5119:
-----------------------------------------
The suggested solution:
script.append("'); if( jQuery.isFunction( w.blur ) && w.blur ) { w.focus();
} ").append(" return false;");
doesn't work for me. It fails with an error in the dev tools' console.
According to http://msdn.microsoft.com/en-us/library/ms536425%28VS.85%29.aspx :
Windows Internet Explorer 8 and later. The focus method no longer brings
child windows (such as those created with the open method) to the foreground.
Child windows now request focus from the user, usually by flashing the title
bar. To directly bring the window to the foreground, add script to the child
window that calls the focus method of its window object.
So it seems there is no way to bring to the foreground a popup with a PDF
content. If the content is HTML then you should use
OnDomReadyHeaderItem.forScript("self.focus()").
Removing the problematic "if (w.blur) w.focus()" doesn't break the current
behavior in Chrome browser, but breaks it in Firefox, i.e. the popup window is
not focused after loading the new content - as in IE.
At the moment I don't have a better solution.
> 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
> Assignee: Martin Grigorov
> Attachments: pages-in-popup.tgz, quickstart-onissue.zip
>
> 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