You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Grigorov (JIRA)" <ji...@apache.org> on 2013/02/27 12:39:13 UTC
[jira] [Commented] (WICKET-5058)
org.apache.wicket.markup.html.link.PopupSettings.java problem (version
6.5.0) target problem
[ https://issues.apache.org/jira/browse/WICKET-5058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13588245#comment-13588245 ]
Martin Grigorov commented on WICKET-5058:
-----------------------------------------
Looking at the code I see that the original idea is to be able to use:
<a href="some.url" onclick="window.open(this.href, ...)" >. That is clicking on a link will open its target/href in a popup. And this is the behavior since Wicket 1.2 at least.
It seems that this functionality is either not widely used or everyone uses #setTarget("'" + url + "'").
We can "fix" this by doing something like:
public void setTarget(String target)
{
if (target.charAt(0) != '\'')
{
target = "'" + target + "'";
}
this.target = target;
}
But this will break any attempt to use the new HTML5 data- attributes: popupSettings.setTarget("this.datalist['popup-url']") + <a data-popup-url="another.url">.
I think we should leave it as it is now.
> org.apache.wicket.markup.html.link.PopupSettings.java problem (version 6.5.0) target problem
> ---------------------------------------------------------------------------------------------
>
> Key: WICKET-5058
> URL: https://issues.apache.org/jira/browse/WICKET-5058
> Project: Wicket
> Issue Type: Bug
> Affects Versions: 6.5.0
> Reporter: Kemal Dogan
> Priority: Minor
> Attachments: TestPopupSettings.tar.gz
>
>
> I think the line (row number=158)
> StringBuilder script = new StringBuilder("var w = window.open(" + target + ", '").append(
> windowTitle).append("', '");
> must be like this. (adding ' "single quotation marks" to target)
> StringBuilder script = new StringBuilder("var w = window.open('" + target + "', '").append(
> windowTitle).append("', '");
> Because,
> when I use like this, it does not work.
> popupSettings.setTarget(myULR);
> target.appendJavaScript(popupSettings.getPopupJavaScript());
> But this worked.
> popupSettings.setTarget("'" + myULR + "'");
> target.appendJavaScript(popupSettings.getPopupJavaScript());
> http://apache-wicket.1842946.n4.nabble.com/org-apache-wicket-markup-html-link-PopupSettings-java-problem-version-6-5-0-td4656735.html
--
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