buildbot success in on wicket-master

2017-03-21 Thread buildbot
The Buildbot has detected a restored build on builder wicket-master while 
building wicket. Full details are available at:
https://ci.apache.org/builders/wicket-master/builds/673

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: bb_slave1_ubuntu

Build Reason: The SingleBranchScheduler scheduler named 
'on-wicket-master-commit' triggered this build
Build Source Stamp: [branch master] d174a6ea38503c88f471154961fb372a56c6c9aa
Blamelist: Sven Meier 

Build succeeded!

Sincerely,
 -The Buildbot





[jira] [Commented] (WICKET-6286) Would be good to have AjaxDownload available out of the box

2017-03-21 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/WICKET-6286?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15935500#comment-15935500
 ] 

ASF subversion and git services commented on WICKET-6286:
-

Commit d174a6ea38503c88f471154961fb372a56c6c9aa in wicket's branch 
refs/heads/master from [~svenmeier]
[ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=d174a6e ]

WICKET-6286 follow jshint

> Would be good to have AjaxDownload available out of the box 
> 
>
> Key: WICKET-6286
> URL: https://issues.apache.org/jira/browse/WICKET-6286
> Project: Wicket
>  Issue Type: New Feature
>  Components: wicket-extensions
>Affects Versions: 8.0.0-M2, 7.5.0
>Reporter: Maxim Solodovnik
>Assignee: Sven Meier
>  Labels: patch
> Fix For: 8.0.0-M5
>
>
> Currently every project need to create own AjaxDownload component based on 
> the Wiki example.
> Unfortunately this component has some issues with WebSockets
> Discussion: http://markmail.org/message/gizsnqh2qgypcgri
> PRs:
> https://github.com/apache/wicket/pull/190
> https://github.com/apache/wicket/pull/191



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


wicket git commit: WICKET-6286 follow jshint

2017-03-21 Thread svenmeier
Repository: wicket
Updated Branches:
  refs/heads/master 399089927 -> d174a6ea3


WICKET-6286 follow jshint

Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/d174a6ea
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/d174a6ea
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/d174a6ea

Branch: refs/heads/master
Commit: d174a6ea38503c88f471154961fb372a56c6c9aa
Parents: 3990899
Author: Sven Meier 
Authored: Tue Mar 21 23:54:09 2017 +0100
Committer: Sven Meier 
Committed: Tue Mar 21 23:54:09 2017 +0100

--
 .../java/org/apache/wicket/extensions/ajax/wicket-ajaxdownload.js  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/wicket/blob/d174a6ea/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/wicket-ajaxdownload.js
--
diff --git 
a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/wicket-ajaxdownload.js
 
b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/wicket-ajaxdownload.js
index 0c232cf..ec81ca4 100644
--- 
a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/wicket-ajaxdownload.js
+++ 
b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/wicket-ajaxdownload.js
@@ -77,7 +77,7 @@
},

dismiss: function(result) {
-   if (result == "failed") {
+   if (result === "failed") {
wo.close();
}
}



buildbot failure in on wicket-master

2017-03-21 Thread buildbot
The Buildbot has detected a new failure on builder wicket-master while building 
wicket. Full details are available at:
https://ci.apache.org/builders/wicket-master/builds/672

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: bb_slave1_ubuntu

Build Reason: The SingleBranchScheduler scheduler named 
'on-wicket-master-commit' triggered this build
Build Source Stamp: [branch master] 3990899278e2dc5a2c60eac9acf71af9716d018c
Blamelist: Martin Tzvetanov Grigorov ,Sven Meier 


BUILD FAILED: failed compile

Sincerely,
 -The Buildbot





[jira] [Commented] (WICKET-6286) Would be good to have AjaxDownload available out of the box

2017-03-21 Thread Sven Meier (JIRA)

[ 
https://issues.apache.org/jira/browse/WICKET-6286?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15935466#comment-15935466
 ] 

Sven Meier commented on WICKET-6286:


I've pushed the changes to Wicket 8.x. Location.NewWindow supports the failure 
callback too now.

> Would be good to have AjaxDownload available out of the box 
> 
>
> Key: WICKET-6286
> URL: https://issues.apache.org/jira/browse/WICKET-6286
> Project: Wicket
>  Issue Type: New Feature
>  Components: wicket-extensions
>Affects Versions: 8.0.0-M2, 7.5.0
>Reporter: Maxim Solodovnik
>Assignee: Sven Meier
>  Labels: patch
> Fix For: 8.0.0-M5
>
>
> Currently every project need to create own AjaxDownload component based on 
> the Wiki example.
> Unfortunately this component has some issues with WebSockets
> Discussion: http://markmail.org/message/gizsnqh2qgypcgri
> PRs:
> https://github.com/apache/wicket/pull/190
> https://github.com/apache/wicket/pull/191



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Updated] (WICKET-6286) Would be good to have AjaxDownload available out of the box

2017-03-21 Thread Sven Meier (JIRA)

 [ 
https://issues.apache.org/jira/browse/WICKET-6286?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sven Meier updated WICKET-6286:
---
Fix Version/s: 8.0.0-M5

> Would be good to have AjaxDownload available out of the box 
> 
>
> Key: WICKET-6286
> URL: https://issues.apache.org/jira/browse/WICKET-6286
> Project: Wicket
>  Issue Type: New Feature
>  Components: wicket-extensions
>Affects Versions: 8.0.0-M2, 7.5.0
>Reporter: Maxim Solodovnik
>Assignee: Sven Meier
>  Labels: patch
> Fix For: 8.0.0-M5
>
>
> Currently every project need to create own AjaxDownload component based on 
> the Wiki example.
> Unfortunately this component has some issues with WebSockets
> Discussion: http://markmail.org/message/gizsnqh2qgypcgri
> PRs:
> https://github.com/apache/wicket/pull/190
> https://github.com/apache/wicket/pull/191



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (WICKET-6286) Would be good to have AjaxDownload available out of the box

2017-03-21 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/WICKET-6286?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15935458#comment-15935458
 ] 

ASF subversion and git services commented on WICKET-6286:
-

Commit 27bb0bbfd888abb6caefaefa63b03e7c02865c22 in wicket's branch 
refs/heads/master from [~mgrigorov]
[ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=27bb0bb ]

WICKET-6286 Add Location.NewWindow - downloads the resource in a new browser 
window/tab


> Would be good to have AjaxDownload available out of the box 
> 
>
> Key: WICKET-6286
> URL: https://issues.apache.org/jira/browse/WICKET-6286
> Project: Wicket
>  Issue Type: New Feature
>  Components: wicket-extensions
>Affects Versions: 8.0.0-M2, 7.5.0
>Reporter: Maxim Solodovnik
>Assignee: Sven Meier
>  Labels: patch
>
> Currently every project need to create own AjaxDownload component based on 
> the Wiki example.
> Unfortunately this component has some issues with WebSockets
> Discussion: http://markmail.org/message/gizsnqh2qgypcgri
> PRs:
> https://github.com/apache/wicket/pull/190
> https://github.com/apache/wicket/pull/191



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (WICKET-6286) Would be good to have AjaxDownload available out of the box

2017-03-21 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/WICKET-6286?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15935454#comment-15935454
 ] 

ASF subversion and git services commented on WICKET-6286:
-

Commit 0957a2b0ec02b09312bfb9f8d5e8aaf9458edb6d in wicket's branch 
refs/heads/master from [~svenmeier]
[ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=0957a2b ]

WICKET-6286 renamed url settings; explained cookie path


> Would be good to have AjaxDownload available out of the box 
> 
>
> Key: WICKET-6286
> URL: https://issues.apache.org/jira/browse/WICKET-6286
> Project: Wicket
>  Issue Type: New Feature
>  Components: wicket-extensions
>Affects Versions: 8.0.0-M2, 7.5.0
>Reporter: Maxim Solodovnik
>Assignee: Sven Meier
>  Labels: patch
>
> Currently every project need to create own AjaxDownload component based on 
> the Wiki example.
> Unfortunately this component has some issues with WebSockets
> Discussion: http://markmail.org/message/gizsnqh2qgypcgri
> PRs:
> https://github.com/apache/wicket/pull/190
> https://github.com/apache/wicket/pull/191



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (WICKET-6286) Would be good to have AjaxDownload available out of the box

2017-03-21 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/WICKET-6286?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15935459#comment-15935459
 ] 

ASF subversion and git services commented on WICKET-6286:
-

Commit a7c01094b369c95316ee103f364f04f57cbba1ad in wicket's branch 
refs/heads/master from [~mgrigorov]
[ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=a7c0109 ]

WICKET-6286 Add support for success callback to 'NewWindow' location

Add 'onDownloadCompleted()' callback that is executed after any success or 
failure callback. Like in jQuery - do something in all cases.

WICKET-6340 Use XHTML friendly markup when creating the iframe


> Would be good to have AjaxDownload available out of the box 
> 
>
> Key: WICKET-6286
> URL: https://issues.apache.org/jira/browse/WICKET-6286
> Project: Wicket
>  Issue Type: New Feature
>  Components: wicket-extensions
>Affects Versions: 8.0.0-M2, 7.5.0
>Reporter: Maxim Solodovnik
>Assignee: Sven Meier
>  Labels: patch
>
> Currently every project need to create own AjaxDownload component based on 
> the Wiki example.
> Unfortunately this component has some issues with WebSockets
> Discussion: http://markmail.org/message/gizsnqh2qgypcgri
> PRs:
> https://github.com/apache/wicket/pull/190
> https://github.com/apache/wicket/pull/191



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (WICKET-6340) The Ajax reponse of an AjaxSubmitButton creates invalid XHTML markup for multipart forms

2017-03-21 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/WICKET-6340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15935460#comment-15935460
 ] 

ASF subversion and git services commented on WICKET-6340:
-

Commit a7c01094b369c95316ee103f364f04f57cbba1ad in wicket's branch 
refs/heads/master from [~mgrigorov]
[ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=a7c0109 ]

WICKET-6286 Add support for success callback to 'NewWindow' location

Add 'onDownloadCompleted()' callback that is executed after any success or 
failure callback. Like in jQuery - do something in all cases.

WICKET-6340 Use XHTML friendly markup when creating the iframe


> The Ajax reponse of an AjaxSubmitButton creates invalid XHTML markup for 
> multipart forms
> 
>
> Key: WICKET-6340
> URL: https://issues.apache.org/jira/browse/WICKET-6340
> Project: Wicket
>  Issue Type: Bug
>  Components: wicket
>Affects Versions: 7.6.0, 6.26.0
> Environment: Jetty 9, Fedora 25
>Reporter: Marcus
>Assignee: Sven Meier
>Priority: Minor
>  Labels: patch, triaged
> Fix For: 6.27.0, 7.7.0, 8.0.0-M5
>
> Attachments: wicket-ajax-jquery-iframe.zip, wicket-ajax-jquery.patch
>
>
> My web pages are delivered as XHTML5 
> ({{response.setContentType("application/xhtml+xml");}}). When I add a 
> multipart form and submit a file, I get strange JavaScript errors about 
> invalid or illegal strings.
> {quote}
> Wicket.Ajax:  An error occurred while executing Ajax request:SyntaxError: An 
> invalid or illegal string was specified 
> XML Parsing Error: mismatched tag. Expected: .
> Address: 
> Row Nr. 1, Column 202:
> {quote}
> I found out that Wicket’s Ajax code is responsible for those problems.
> {code:title=wicket-ajax-jquery.js, row 70|borderStyle=solid}
> createIFrame = function (iframeName) {
>   var $iframe = jQuery('');
>   return $iframe[0];
> };
> {code}
> The iframe tag isn’t closed. This is fine for HTML5, but not for XHTML5.
> I have attached a quite minimal Wicket project were the problems can be 
> examined:
> {code}
> mkdir wicket-ajax-jquery-iframe
> mv wicket-ajax-jquery-iframe.zip wicket-ajax-jquery-iframe
> cd wicket-ajax-jquery-iframe
> unzip wicket-ajax-jquery-iframe.zip
> mvn package
> mvn jetty:run-war
> {code}
> Open your browser’s console and upload any file on localhost:8080.
> A patch which fixes this issued is attached. Thanks for your help.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (WICKET-6286) Would be good to have AjaxDownload available out of the box

2017-03-21 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/WICKET-6286?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15935461#comment-15935461
 ] 

ASF subversion and git services commented on WICKET-6286:
-

Commit 3990899278e2dc5a2c60eac9acf71af9716d018c in wicket's branch 
refs/heads/master from [~svenmeier]
[ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=3990899 ]

WICKET-6286 support failure callback for NewWindow too


> Would be good to have AjaxDownload available out of the box 
> 
>
> Key: WICKET-6286
> URL: https://issues.apache.org/jira/browse/WICKET-6286
> Project: Wicket
>  Issue Type: New Feature
>  Components: wicket-extensions
>Affects Versions: 8.0.0-M2, 7.5.0
>Reporter: Maxim Solodovnik
>Assignee: Sven Meier
>  Labels: patch
>
> Currently every project need to create own AjaxDownload component based on 
> the Wiki example.
> Unfortunately this component has some issues with WebSockets
> Discussion: http://markmail.org/message/gizsnqh2qgypcgri
> PRs:
> https://github.com/apache/wicket/pull/190
> https://github.com/apache/wicket/pull/191



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (WICKET-6286) Would be good to have AjaxDownload available out of the box

2017-03-21 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/WICKET-6286?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15935455#comment-15935455
 ] 

ASF subversion and git services commented on WICKET-6286:
-

Commit b93494439359946021d2595a47a20b1fac65356c in wicket's branch 
refs/heads/master from [~mgrigorov]
[ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=b934944 ]

WICKET-6286 Add wicket-ajaxdownload.js to the JS Lint checked files list.

Remove tree.js - it has been deleted long time ago


> Would be good to have AjaxDownload available out of the box 
> 
>
> Key: WICKET-6286
> URL: https://issues.apache.org/jira/browse/WICKET-6286
> Project: Wicket
>  Issue Type: New Feature
>  Components: wicket-extensions
>Affects Versions: 8.0.0-M2, 7.5.0
>Reporter: Maxim Solodovnik
>Assignee: Sven Meier
>  Labels: patch
>
> Currently every project need to create own AjaxDownload component based on 
> the Wiki example.
> Unfortunately this component has some issues with WebSockets
> Discussion: http://markmail.org/message/gizsnqh2qgypcgri
> PRs:
> https://github.com/apache/wicket/pull/190
> https://github.com/apache/wicket/pull/191



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (WICKET-6286) Would be good to have AjaxDownload available out of the box

2017-03-21 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/WICKET-6286?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15935457#comment-15935457
 ] 

ASF subversion and git services commented on WICKET-6286:
-

Commit ab5675ec9a364cf2b1fe483219863d233e593cba in wicket's branch 
refs/heads/master from [~mgrigorov]
[ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=ab5675e ]

WICKET-6286 Add setting to control how to download the resource - via iframe 
(default) or via document.location


> Would be good to have AjaxDownload available out of the box 
> 
>
> Key: WICKET-6286
> URL: https://issues.apache.org/jira/browse/WICKET-6286
> Project: Wicket
>  Issue Type: New Feature
>  Components: wicket-extensions
>Affects Versions: 8.0.0-M2, 7.5.0
>Reporter: Maxim Solodovnik
>Assignee: Sven Meier
>  Labels: patch
>
> Currently every project need to create own AjaxDownload component based on 
> the Wiki example.
> Unfortunately this component has some issues with WebSockets
> Discussion: http://markmail.org/message/gizsnqh2qgypcgri
> PRs:
> https://github.com/apache/wicket/pull/190
> https://github.com/apache/wicket/pull/191



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[2/7] wicket git commit: WICKET-6286 renamed url settings; explained cookie path

2017-03-21 Thread svenmeier
WICKET-6286 renamed url settings; explained cookie path


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/0957a2b0
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/0957a2b0
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/0957a2b0

Branch: refs/heads/master
Commit: 0957a2b0ec02b09312bfb9f8d5e8aaf9458edb6d
Parents: 5578e69
Author: Sven Meier 
Authored: Thu Jan 5 09:12:20 2017 +0100
Committer: Sven Meier 
Committed: Tue Mar 21 23:23:16 2017 +0100

--
 .../java/org/apache/wicket/extensions/ajax/AjaxDownload.java  | 7 ++-
 .../org/apache/wicket/extensions/ajax/wicket-ajaxdownload.js  | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/wicket/blob/0957a2b0/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/AjaxDownload.java
--
diff --git 
a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/AjaxDownload.java
 
b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/AjaxDownload.java
index a879d5b..11c97d4 100644
--- 
a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/AjaxDownload.java
+++ 
b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/AjaxDownload.java
@@ -193,7 +193,7 @@ public class AjaxDownload extends 
AbstractDefaultAjaxBehavior
JSONObject settings = new JSONObject();
settings.put("attributes", new 
JsonFunction(renderAjaxAttributes(getComponent(;
settings.put("name", getName());
-   settings.put("url", url);
+   settings.put("downloadUrl", url);
 

target.appendJavaScript(String.format("Wicket.AjaxDownload.initiate(%s);", 
settings));
 
@@ -289,7 +289,12 @@ public class AjaxDownload extends 
AbstractDefaultAjaxBehavior
private static Cookie cookie(String name)
{
Cookie cookie = new Cookie(name, "complete");
+   
+   // has to be on root, otherwise JavaScript will not be able to 
access the
+   // cookie when it is set from a different path - which is the 
case when a
+   // ResourceReference is used
cookie.setPath("/");
+   
return cookie;
}
 }

http://git-wip-us.apache.org/repos/asf/wicket/blob/0957a2b0/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/wicket-ajaxdownload.js
--
diff --git 
a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/wicket-ajaxdownload.js
 
b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/wicket-ajaxdownload.js
index 52471df..a383fa8 100644
--- 
a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/wicket-ajaxdownload.js
+++ 
b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/wicket-ajaxdownload.js
@@ -28,7 +28,7 @@
Wicket.AjaxDownload = {
initiate : function(settings) {

-   var frame = jQuery("").hide().prop("src", 
settings.url).appendTo("body");
+   var frame = jQuery("").hide().prop("src", 
settings.downloadUrl).appendTo("body");

var checkComplete = function() {
var result;



[6/7] wicket git commit: WICKET-6286 Add support for success callback to 'NewWindow' location

2017-03-21 Thread svenmeier
WICKET-6286 Add support for success callback to 'NewWindow' location

Add 'onDownloadCompleted()' callback that is executed after any success or 
failure callback. Like in jQuery - do something in all cases.

WICKET-6340 Use XHTML friendly markup when creating the iframe


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/a7c01094
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/a7c01094
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/a7c01094

Branch: refs/heads/master
Commit: a7c01094b369c95316ee103f364f04f57cbba1ad
Parents: 27bb0bb
Author: Martin Tzvetanov Grigorov 
Authored: Mon Mar 20 17:26:23 2017 +0100
Committer: Sven Meier 
Committed: Tue Mar 21 23:23:17 2017 +0100

--
 .../examples/ajax/builtin/AjaxDownloadPage.java |  9 ++-
 .../wicket/extensions/ajax/AjaxDownload.java| 28 +++-
 .../extensions/ajax/wicket-ajaxdownload.js  | 24 ++---
 3 files changed, 50 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/wicket/blob/a7c01094/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxDownloadPage.java
--
diff --git 
a/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxDownloadPage.java
 
b/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxDownloadPage.java
index 3a7ccb5..b339b64 100644
--- 
a/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxDownloadPage.java
+++ 
b/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxDownloadPage.java
@@ -252,8 +252,15 @@ public class AjaxDownloadPage extends BasePage
downloadingContainer.setVisible(false);
target.add(downloadingContainer);
}
+
+   @Override
+   protected void onDownloadCompleted(AjaxRequestTarget 
target)
+   {
+   downloadingContainer.setVisible(false);
+   target.add(downloadingContainer);
+   }
};
-   download.setLocation(AjaxDownload.Location.NewWindow);
+   download.setLocation(AjaxDownload.Location.SameWindow);
add(download);
 
add(new AjaxLink("downloadInNewWindow")

http://git-wip-us.apache.org/repos/asf/wicket/blob/a7c01094/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/AjaxDownload.java
--
diff --git 
a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/AjaxDownload.java
 
b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/AjaxDownload.java
index aacbfd9..34595e6 100644
--- 
a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/AjaxDownload.java
+++ 
b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/AjaxDownload.java
@@ -72,18 +72,23 @@ public class AjaxDownload extends 
AbstractDefaultAjaxBehavior
 * The resource will be downloaded via a temporary created 
iframe.
 * This is recommended when there are resources in the DOM 
which will be
 * closed automatically on JavaScript unload event, 
like WebSockets.
+* Supports both success and failure 
callbacks!
 */
IFrame,
 
/**
 * The resource will be downloaded by changing the location of 
the current DOM document.
 * Note: This will trigger JavaScript unload event on 
the page!
+* Supports only success callback, i.e. it is not 
possible to detect whether
+* the download has finished successfully or not.
 */
-   Self,
+   SameWindow,
 
/**
 * The resource will be downloaded in a new browser window by 
using JavaScript
 * window.open() API.
+* Supports only success callback, i.e. it is not 
possible to detect whether
+* the download has finished successfully or not.
 */
NewWindow
}
@@ -230,14 +235,34 @@ public class AjaxDownload extends 
AbstractDefaultAjaxBehavior
{
}
 
+   /**
+* A callback executed when the download of the resource finished 
successfully.
+*
+* @param target The Ajax request handler
+*/
protected void onDownloadSuccess(AjaxRequestTarget target)
{
}
 
+   /**
+* A callback executed when the download of the resource failed 

[jira] [Commented] (WICKET-6286) Would be good to have AjaxDownload available out of the box

2017-03-21 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/WICKET-6286?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15935453#comment-15935453
 ] 

ASF subversion and git services commented on WICKET-6286:
-

Commit 5578e6982b93f81be23c56c8ece90b6f68440eb7 in wicket's branch 
refs/heads/master from [~svenmeier]
[ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=5578e69 ]

WICKET-6286 ajax download


> Would be good to have AjaxDownload available out of the box 
> 
>
> Key: WICKET-6286
> URL: https://issues.apache.org/jira/browse/WICKET-6286
> Project: Wicket
>  Issue Type: New Feature
>  Components: wicket-extensions
>Affects Versions: 8.0.0-M2, 7.5.0
>Reporter: Maxim Solodovnik
>Assignee: Sven Meier
>  Labels: patch
>
> Currently every project need to create own AjaxDownload component based on 
> the Wiki example.
> Unfortunately this component has some issues with WebSockets
> Discussion: http://markmail.org/message/gizsnqh2qgypcgri
> PRs:
> https://github.com/apache/wicket/pull/190
> https://github.com/apache/wicket/pull/191



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[4/7] wicket git commit: WICKET-6286 Add wicket-ajaxdownload.js to the JS Lint checked files list.

2017-03-21 Thread svenmeier
WICKET-6286 Add wicket-ajaxdownload.js to the JS Lint checked files list.

Remove tree.js - it has been deleted long time ago


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/b9349443
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/b9349443
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/b9349443

Branch: refs/heads/master
Commit: b93494439359946021d2595a47a20b1fac65356c
Parents: 0957a2b
Author: Martin Tzvetanov Grigorov 
Authored: Tue Jan 31 22:49:18 2017 +0100
Committer: Sven Meier 
Committed: Tue Mar 21 23:23:16 2017 +0100

--
 testing/wicket-js-tests/Gruntfile.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/wicket/blob/b9349443/testing/wicket-js-tests/Gruntfile.js
--
diff --git a/testing/wicket-js-tests/Gruntfile.js 
b/testing/wicket-js-tests/Gruntfile.js
index 03d0801..6cb79bd 100644
--- a/testing/wicket-js-tests/Gruntfile.js
+++ b/testing/wicket-js-tests/Gruntfile.js
@@ -28,8 +28,8 @@ module.exports = function(grunt) {
],
extensionsJs = [

"../../wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/progressbar.js",
+   
"../../wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/wicket-ajaxdownload.js",

"../../wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/form/palette/palette.js",
-   
"../../wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/tree/res/tree.js",

"../../wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/wicket-autocomplete.js",

"../../wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/res/modal.js",

"../../wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/filter/wicket-filterform.js"



[3/7] wicket git commit: WICKET-6286 ajax download

2017-03-21 Thread svenmeier
WICKET-6286 ajax download


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/5578e698
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/5578e698
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/5578e698

Branch: refs/heads/master
Commit: 5578e6982b93f81be23c56c8ece90b6f68440eb7
Parents: fd6befd
Author: Sven Meier 
Authored: Wed Jan 4 00:00:01 2017 +0100
Committer: Sven Meier 
Committed: Tue Mar 21 23:23:16 2017 +0100

--
 .../examples/ajax/builtin/AjaxApplication.java  |   2 +-
 .../examples/ajax/builtin/AjaxDownloadPage.html |  41 +++
 .../examples/ajax/builtin/AjaxDownloadPage.java | 244 +++
 .../wicket/examples/ajax/builtin/Index.html |   2 +
 .../wicket/extensions/ajax/AjaxDownload.java| 295 +++
 .../extensions/ajax/wicket-ajaxdownload.js  |  60 
 6 files changed, 643 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/wicket/blob/5578e698/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxApplication.java
--
diff --git 
a/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxApplication.java
 
b/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxApplication.java
index 871fdbf..dd44b56 100644
--- 
a/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxApplication.java
+++ 
b/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxApplication.java
@@ -57,7 +57,7 @@ public class AjaxApplication extends WicketExampleApplication
mountPage("todo-list", TodoList.class);
mountPage("world-clock", WorldClockPage.class);
mountPage("upload", FileUploadPage.class);
-
+   mountPage("download", AjaxDownloadPage.class);
}
 
/**

http://git-wip-us.apache.org/repos/asf/wicket/blob/5578e698/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxDownloadPage.html
--
diff --git 
a/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxDownloadPage.html
 
b/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxDownloadPage.html
new file mode 100644
index 000..2764b25
--- /dev/null
+++ 
b/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxDownloadPage.html
@@ -0,0 +1,41 @@
+
+http://wicket.apache.org;>
+
+
+
+   .download-veil {
+   position: absolute;
+   left: 20%;
+   right: 20%;
+   color: white;
+   background-color: darkorange;
+   font-size: 40px;
+   text-align: center;
+   }
+
+   .download-veil span {
+   line-height: 128px;
+   }
+
+
+
+
+
+
+
+This example demonstrates a download initiated via 
Ajax.
+
+
+
+This download fails.
+
+
+
+A resource reference can be used too.
+
+
+Preparing download 
...
+
+
+
+

http://git-wip-us.apache.org/repos/asf/wicket/blob/5578e698/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxDownloadPage.java
--
diff --git 
a/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxDownloadPage.java
 
b/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxDownloadPage.java
new file mode 100644
index 000..a23368c
--- /dev/null
+++ 
b/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxDownloadPage.java
@@ -0,0 +1,244 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.wicket.examples.ajax.builtin;
+
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.extensions.ajax.AjaxDownload;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import 

[1/7] wicket git commit: WICKET-6286 Add setting to control how to download the resource - via iframe (default) or via document.location

2017-03-21 Thread svenmeier
Repository: wicket
Updated Branches:
  refs/heads/master fd6befd02 -> 399089927


WICKET-6286 Add setting to control how to download the resource - via iframe 
(default) or via document.location


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/ab5675ec
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/ab5675ec
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/ab5675ec

Branch: refs/heads/master
Commit: ab5675ec9a364cf2b1fe483219863d233e593cba
Parents: b934944
Author: Martin Tzvetanov Grigorov 
Authored: Tue Jan 31 22:52:09 2017 +0100
Committer: Sven Meier 
Committed: Tue Mar 21 23:23:16 2017 +0100

--
 .../wicket/extensions/ajax/AjaxDownload.java| 29 ++
 .../extensions/ajax/wicket-ajaxdownload.js  | 40 +---
 2 files changed, 55 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/wicket/blob/ab5675ec/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/AjaxDownload.java
--
diff --git 
a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/AjaxDownload.java
 
b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/AjaxDownload.java
index 11c97d4..0b941de 100644
--- 
a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/AjaxDownload.java
+++ 
b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/AjaxDownload.java
@@ -40,6 +40,8 @@ import org.apache.wicket.request.resource.ResourceReference;
 import org.apache.wicket.resource.JQueryPluginResourceReference;
 import org.apache.wicket.util.lang.Args;
 
+import java.util.Locale;
+
 /**
  * Download resources via Ajax.
  * 
@@ -65,6 +67,21 @@ public class AjaxDownload extends AbstractDefaultAjaxBehavior
 {
private static final long serialVersionUID = 1L;
 
+   public enum Location {
+   /**
+* The resource will be downloaded via a temporary created 
iframe.
+* This is recommended when there are resources in the DOM 
which will be
+* closed automatically on JavaScript unload event, 
like WebSockets.
+*/
+   IFrame,
+
+   /**
+* The resource will be downloaded by changing the location of 
the current DOM document.
+* Note: This will trigger JavaScript unload event on 
the page!
+*/
+   Self
+   }
+
/**
 * Name of parameter used to transfer the download identifier to the 
resource.
 *
@@ -81,6 +98,8 @@ public class AjaxDownload extends AbstractDefaultAjaxBehavior
 
private PageParameters resourceParameters;
 
+   private Location location = Location.IFrame;
+
/**
 * Download of a {@link Resource}.
 * 
@@ -194,6 +213,7 @@ public class AjaxDownload extends 
AbstractDefaultAjaxBehavior
settings.put("attributes", new 
JsonFunction(renderAjaxAttributes(getComponent(;
settings.put("name", getName());
settings.put("downloadUrl", url);
+   settings.put("method", 
location.name().toLowerCase(Locale.ENGLISH));
 

target.appendJavaScript(String.format("Wicket.AjaxDownload.initiate(%s);", 
settings));
 
@@ -231,6 +251,15 @@ public class AjaxDownload extends 
AbstractDefaultAjaxBehavior
}
}
 
+   public final Location getLocation() {
+   return location;
+   }
+
+   public AjaxDownload setLocation(final Location location) {
+   this.location = Args.notNull(location, "location");
+   return this;
+   }
+
/**
 * Identifying name of this behavior.
 */

http://git-wip-us.apache.org/repos/asf/wicket/blob/ab5675ec/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/wicket-ajaxdownload.js
--
diff --git 
a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/wicket-ajaxdownload.js
 
b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/wicket-ajaxdownload.js
index a383fa8..b821883 100644
--- 
a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/wicket-ajaxdownload.js
+++ 
b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/wicket-ajaxdownload.js
@@ -27,15 +27,13 @@
 
Wicket.AjaxDownload = {
initiate : function(settings) {
-   
-   var frame = jQuery("").hide().prop("src", 
settings.downloadUrl).appendTo("body");
-   
-   var checkComplete = function() {
+
+   var 

[5/7] wicket git commit: WICKET-6286 Add Location.NewWindow - downloads the resource in a new browser window/tab

2017-03-21 Thread svenmeier
WICKET-6286 Add Location.NewWindow - downloads the resource in a new browser 
window/tab


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/27bb0bbf
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/27bb0bbf
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/27bb0bbf

Branch: refs/heads/master
Commit: 27bb0bbfd888abb6caefaefa63b03e7c02865c22
Parents: ab5675e
Author: Martin Tzvetanov Grigorov 
Authored: Tue Mar 7 22:05:48 2017 +0100
Committer: Sven Meier 
Committed: Tue Mar 21 23:23:17 2017 +0100

--
 .../examples/ajax/builtin/AjaxDownloadPage.html |  6 ++
 .../examples/ajax/builtin/AjaxDownloadPage.java | 62 +++-
 .../wicket/extensions/ajax/AjaxDownload.java|  8 ++-
 .../extensions/ajax/wicket-ajaxdownload.js  |  7 ++-
 4 files changed, 77 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/wicket/blob/27bb0bbf/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxDownloadPage.html
--
diff --git 
a/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxDownloadPage.html
 
b/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxDownloadPage.html
index 2764b25..670c736 100644
--- 
a/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxDownloadPage.html
+++ 
b/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxDownloadPage.html
@@ -34,6 +34,12 @@ This download fails.
 A resource reference can be used too.
 
 
+
+This example demonstrates a download
+initiated via Ajax and serving the response in a new browser window.
+
+
+
 Preparing download 
...
 
 

http://git-wip-us.apache.org/repos/asf/wicket/blob/27bb0bbf/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxDownloadPage.java
--
diff --git 
a/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxDownloadPage.java
 
b/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxDownloadPage.java
index a23368c..3a7ccb5 100644
--- 
a/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxDownloadPage.java
+++ 
b/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxDownloadPage.java
@@ -51,10 +51,12 @@ public class AjaxDownloadPage extends BasePage
add(downloadingContainer);

initDownload();
-   
+
initDownloadFailure();
-   
+
initDownloadReference();
+
+   initDownloadInNewWindow();
}
 
private void initDownload()
@@ -209,7 +211,61 @@ public class AjaxDownloadPage extends BasePage
}
});
}
-   
+
+   private void initDownloadInNewWindow()
+   {
+   IResource resource = new ResourceStreamResource() {
+   protected IResourceStream getResourceStream() {
+   // simulate delay
+   try
+   {
+   TimeUnit.MILLISECONDS.sleep(5000);
+   }
+   catch (InterruptedException e)
+   {
+   }
+
+   return new StringResourceStream("downloaded via 
ajax in a new browser window");
+   };
+
+   
}.setFileName("File-from-IResource.txt").setContentDisposition(ContentDisposition.INLINE).setCacheDuration(Duration.NONE);
+
+   final AjaxDownload download = new AjaxDownload(resource) {
+
+   @Override
+   protected void onBeforeDownload(AjaxRequestTarget 
target)
+   {
+   downloadingContainer.setVisible(true);
+   target.add(downloadingContainer);
+   }
+
+   @Override
+   protected void onDownloadSuccess(AjaxRequestTarget 
target)
+   {
+   downloadingContainer.setVisible(false);
+   target.add(downloadingContainer);
+   }
+
+   @Override
+   protected void onDownloadFailed(AjaxRequestTarget 
target)
+   {
+   downloadingContainer.setVisible(false);
+   target.add(downloadingContainer);
+   }
+   };
+

[7/7] wicket git commit: WICKET-6286 support failure callback for NewWindow too

2017-03-21 Thread svenmeier
WICKET-6286 support failure callback for NewWindow too


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/39908992
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/39908992
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/39908992

Branch: refs/heads/master
Commit: 3990899278e2dc5a2c60eac9acf71af9716d018c
Parents: a7c0109
Author: Sven Meier 
Authored: Tue Mar 21 23:09:53 2017 +0100
Committer: Sven Meier 
Committed: Tue Mar 21 23:23:17 2017 +0100

--
 .../examples/ajax/builtin/AjaxDownloadPage.html |  18 +-
 .../examples/ajax/builtin/AjaxDownloadPage.java | 164 +++
 wicket-examples/src/main/webapp/WEB-INF/web.xml |  21 ---
 .../wicket/extensions/ajax/AjaxDownload.java|  42 +++--
 .../extensions/ajax/wicket-ajaxdownload.js  |  54 --
 5 files changed, 163 insertions(+), 136 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/wicket/blob/39908992/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxDownloadPage.html
--
diff --git 
a/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxDownloadPage.html
 
b/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxDownloadPage.html
index 670c736..0be7fe2 100644
--- 
a/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxDownloadPage.html
+++ 
b/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxDownloadPage.html
@@ -23,23 +23,19 @@
 
 
 
-This example demonstrates a download initiated via 
Ajax.
+   All links below initiate a download of a resource via Ajax (failing 
every third time): 
 
 
-
-This download fails.
-
-
-
-A resource reference can be used too.
-
+
+   via an iframe.
+   in a new browser window.
+   in the same window.
+
 
 
-This example demonstrates a download
-initiated via Ajax and serving the response in a new browser window.
+   Alternatively a resource reference 
can be used too.
 
 
-
 Preparing download 
...
 
 

http://git-wip-us.apache.org/repos/asf/wicket/blob/39908992/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxDownloadPage.java
--
diff --git 
a/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxDownloadPage.java
 
b/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxDownloadPage.java
index b339b64..b589091 100644
--- 
a/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxDownloadPage.java
+++ 
b/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/AjaxDownloadPage.java
@@ -16,6 +16,8 @@
  */
 package org.apache.wicket.examples.ajax.builtin;
 
+import java.util.concurrent.TimeUnit;
+
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.ajax.markup.html.AjaxLink;
 import org.apache.wicket.extensions.ajax.AjaxDownload;
@@ -29,8 +31,6 @@ import org.apache.wicket.util.resource.IResourceStream;
 import org.apache.wicket.util.resource.StringResourceStream;
 import org.apache.wicket.util.time.Duration;
 
-import java.util.concurrent.TimeUnit;
-
 /**
  * Ajax download.
  * 
@@ -52,30 +52,26 @@ public class AjaxDownloadPage extends BasePage

initDownload();
 
-   initDownloadFailure();
+   initDownloadInNewWindow();
 
-   initDownloadReference();
+   initDownloadInSameWindow();
 
-   initDownloadInNewWindow();
+   initDownloadReference();
}
 
+   @Override
+   protected void onConfigure()
+   {
+   super.onConfigure();
+
+   // download cannot continue on page refresh
+   downloadingContainer.setVisible(false);
+   }
+   
private void initDownload()
{
-   IResource resource = new ResourceStreamResource() {
-   protected IResourceStream getResourceStream() {
-   // simulate delay
-   try
-   {
-   TimeUnit.MILLISECONDS.sleep(5000);
-   }
-   catch (InterruptedException e)
-   {
-   }
-   
-   return new StringResourceStream("downloaded via 
ajax");
-   };
-   
-   
}.setFileName("File-from-IResource.txt").setContentDisposition(ContentDisposition.ATTACHMENT).setCacheDuration(Duration.NONE);
+   

[jira] [Commented] (WICKET-6340) The Ajax reponse of an AjaxSubmitButton creates invalid XHTML markup for multipart forms

2017-03-21 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/WICKET-6340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15935261#comment-15935261
 ] 

ASF subversion and git services commented on WICKET-6340:
-

Commit 84d557ab14c4e06352d937f786b0d97b6194e187 in wicket's branch 
refs/heads/wicket-7.x from [~mgrigorov]
[ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=84d557a ]

WICKET-6340 improve support for XHTML markup


> The Ajax reponse of an AjaxSubmitButton creates invalid XHTML markup for 
> multipart forms
> 
>
> Key: WICKET-6340
> URL: https://issues.apache.org/jira/browse/WICKET-6340
> Project: Wicket
>  Issue Type: Bug
>  Components: wicket
>Affects Versions: 7.6.0, 6.26.0
> Environment: Jetty 9, Fedora 25
>Reporter: Marcus
>Assignee: Sven Meier
>Priority: Minor
>  Labels: patch, triaged
> Fix For: 6.27.0, 7.7.0, 8.0.0-M5
>
> Attachments: wicket-ajax-jquery-iframe.zip, wicket-ajax-jquery.patch
>
>
> My web pages are delivered as XHTML5 
> ({{response.setContentType("application/xhtml+xml");}}). When I add a 
> multipart form and submit a file, I get strange JavaScript errors about 
> invalid or illegal strings.
> {quote}
> Wicket.Ajax:  An error occurred while executing Ajax request:SyntaxError: An 
> invalid or illegal string was specified 
> XML Parsing Error: mismatched tag. Expected: .
> Address: 
> Row Nr. 1, Column 202:
> {quote}
> I found out that Wicket’s Ajax code is responsible for those problems.
> {code:title=wicket-ajax-jquery.js, row 70|borderStyle=solid}
> createIFrame = function (iframeName) {
>   var $iframe = jQuery('');
>   return $iframe[0];
> };
> {code}
> The iframe tag isn’t closed. This is fine for HTML5, but not for XHTML5.
> I have attached a quite minimal Wicket project were the problems can be 
> examined:
> {code}
> mkdir wicket-ajax-jquery-iframe
> mv wicket-ajax-jquery-iframe.zip wicket-ajax-jquery-iframe
> cd wicket-ajax-jquery-iframe
> unzip wicket-ajax-jquery-iframe.zip
> mvn package
> mvn jetty:run-war
> {code}
> Open your browser’s console and upload any file on localhost:8080.
> A patch which fixes this issued is attached. Thanks for your help.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (WICKET-6340) The Ajax reponse of an AjaxSubmitButton creates invalid XHTML markup for multipart forms

2017-03-21 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/WICKET-6340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15935263#comment-15935263
 ] 

ASF subversion and git services commented on WICKET-6340:
-

Commit fd6befd0201070bb024fbbb37595463ea22c9413 in wicket's branch 
refs/heads/master from [~mgrigorov]
[ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=fd6befd ]

WICKET-6340 improve support for XHTML markup


> The Ajax reponse of an AjaxSubmitButton creates invalid XHTML markup for 
> multipart forms
> 
>
> Key: WICKET-6340
> URL: https://issues.apache.org/jira/browse/WICKET-6340
> Project: Wicket
>  Issue Type: Bug
>  Components: wicket
>Affects Versions: 7.6.0, 6.26.0
> Environment: Jetty 9, Fedora 25
>Reporter: Marcus
>Assignee: Sven Meier
>Priority: Minor
>  Labels: patch, triaged
> Fix For: 6.27.0, 7.7.0, 8.0.0-M5
>
> Attachments: wicket-ajax-jquery-iframe.zip, wicket-ajax-jquery.patch
>
>
> My web pages are delivered as XHTML5 
> ({{response.setContentType("application/xhtml+xml");}}). When I add a 
> multipart form and submit a file, I get strange JavaScript errors about 
> invalid or illegal strings.
> {quote}
> Wicket.Ajax:  An error occurred while executing Ajax request:SyntaxError: An 
> invalid or illegal string was specified 
> XML Parsing Error: mismatched tag. Expected: .
> Address: 
> Row Nr. 1, Column 202:
> {quote}
> I found out that Wicket’s Ajax code is responsible for those problems.
> {code:title=wicket-ajax-jquery.js, row 70|borderStyle=solid}
> createIFrame = function (iframeName) {
>   var $iframe = jQuery('');
>   return $iframe[0];
> };
> {code}
> The iframe tag isn’t closed. This is fine for HTML5, but not for XHTML5.
> I have attached a quite minimal Wicket project were the problems can be 
> examined:
> {code}
> mkdir wicket-ajax-jquery-iframe
> mv wicket-ajax-jquery-iframe.zip wicket-ajax-jquery-iframe
> cd wicket-ajax-jquery-iframe
> unzip wicket-ajax-jquery-iframe.zip
> mvn package
> mvn jetty:run-war
> {code}
> Open your browser’s console and upload any file on localhost:8080.
> A patch which fixes this issued is attached. Thanks for your help.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


wicket git commit: WICKET-6340 improve support for XHTML markup

2017-03-21 Thread mgrigorov
Repository: wicket
Updated Branches:
  refs/heads/master 267e3f512 -> fd6befd02


WICKET-6340 improve support for XHTML markup


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/fd6befd0
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/fd6befd0
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/fd6befd0

Branch: refs/heads/master
Commit: fd6befd0201070bb024fbbb37595463ea22c9413
Parents: 267e3f5
Author: Martin Tzvetanov Grigorov 
Authored: Tue Mar 21 21:27:21 2017 +0100
Committer: Martin Tzvetanov Grigorov 
Committed: Tue Mar 21 21:27:55 2017 +0100

--
 .../wicket/extensions/ajax/markup/html/form/upload/progressbar.js  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/wicket/blob/fd6befd0/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/progressbar.js
--
diff --git 
a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/progressbar.js
 
b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/progressbar.js
index e91098c..bf43d52 100644
--- 
a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/progressbar.js
+++ 
b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/progressbar.js
@@ -81,7 +81,7 @@
 
_createIFrame : function (iframeName) {
var $iframe = jQuery('');
+   '" src="about:blank" style="position: absolute; 
top: -px; left: -px;">');
return $iframe[0];
},
 



wicket git commit: WICKET-6340 improve support for XHTML markup

2017-03-21 Thread mgrigorov
Repository: wicket
Updated Branches:
  refs/heads/wicket-7.x d0b8f38ff -> 84d557ab1


WICKET-6340 improve support for XHTML markup


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/84d557ab
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/84d557ab
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/84d557ab

Branch: refs/heads/wicket-7.x
Commit: 84d557ab14c4e06352d937f786b0d97b6194e187
Parents: d0b8f38
Author: Martin Tzvetanov Grigorov 
Authored: Tue Mar 21 21:27:21 2017 +0100
Committer: Martin Tzvetanov Grigorov 
Committed: Tue Mar 21 21:27:21 2017 +0100

--
 .../wicket/extensions/ajax/markup/html/form/upload/progressbar.js  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/wicket/blob/84d557ab/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/progressbar.js
--
diff --git 
a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/progressbar.js
 
b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/progressbar.js
index e91098c..bf43d52 100644
--- 
a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/progressbar.js
+++ 
b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/progressbar.js
@@ -81,7 +81,7 @@
 
_createIFrame : function (iframeName) {
var $iframe = jQuery('');
+   '" src="about:blank" style="position: absolute; 
top: -px; left: -px;">');
return $iframe[0];
},