[jira] [Created] (WICKET-6617) Header contribution ignore

2018-12-02 Thread Maxim Solodovnik (JIRA)
Maxim Solodovnik created WICKET-6617:


 Summary: Header contribution ignore 
 Key: WICKET-6617
 URL: https://issues.apache.org/jira/browse/WICKET-6617
 Project: Wicket
  Issue Type: Bug
  Components: wicket-core
Affects Versions: 8.2.0
Reporter: Maxim Solodovnik
Assignee: Maxim Solodovnik


Components added via AJAX and contributing to  using @Override renderHead 
ignores  if any



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (WICKET-6617) Header contribution ignore

2018-12-02 Thread ASF subversion and git services (JIRA)


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

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

Commit a529aadafdaf7b32e909bbf90fe32822e841877f in wicket's branch 
refs/heads/WICKET-6617-header-placeholder from [~solomax]
[ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=a529aad ]

[WICKET-6617] headers are added to header-items if specified


> Header contribution ignore 
> -
>
> Key: WICKET-6617
> URL: https://issues.apache.org/jira/browse/WICKET-6617
> Project: Wicket
>  Issue Type: Bug
>  Components: wicket-core
>Affects Versions: 8.2.0
>Reporter: Maxim Solodovnik
>Assignee: Maxim Solodovnik
>Priority: Major
>
> Components added via AJAX and contributing to  using @Override 
> renderHead ignores  if any



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


wicket git commit: [WICKET-6617] headers are added to header-items if specified

2018-12-02 Thread solomax
Repository: wicket
Updated Branches:
  refs/heads/WICKET-6617-header-placeholder [created] a529aadaf


[WICKET-6617] headers are added to header-items if specified


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

Branch: refs/heads/WICKET-6617-header-placeholder
Commit: a529aadafdaf7b32e909bbf90fe32822e841877f
Parents: 64ef164
Author: Maxim Solodovnik 
Authored: Sun Dec 2 15:09:37 2018 +0700
Committer: Maxim Solodovnik 
Committed: Sun Dec 2 15:09:37 2018 +0700

--
 .../wicket/ajax/res/js/wicket-ajax-jquery.js| 11 +++--
 .../html/internal/HtmlHeaderContainer.java  | 46 ++--
 .../html/internal/HtmlHeaderItemsContainer.java |  9 
 3 files changed, 40 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/wicket/blob/a529aada/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
--
diff --git 
a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js 
b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
index 8370208..b93a98b 100644
--- 
a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
+++ 
b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
@@ -2116,10 +2116,15 @@
 
// Adds the element to page head
addElement: function (element) {
-   var head = 
document.getElementsByTagName("head");
+   var headItems = document.querySelector('head 
meta[name="wicket.header.items"]');
+   if (headItems) {
+   
headItems.parentNode.insertBefore(element, headItems);
+   } else {
+   var head = 
document.querySelector("head");
 
-   if (head[0]) {
-   head[0].appendChild(element);
+   if (head) {
+   head.appendChild(element);
+   }
}
},
 

http://git-wip-us.apache.org/repos/asf/wicket/blob/a529aada/wicket-core/src/main/java/org/apache/wicket/markup/html/internal/HtmlHeaderContainer.java
--
diff --git 
a/wicket-core/src/main/java/org/apache/wicket/markup/html/internal/HtmlHeaderContainer.java
 
b/wicket-core/src/main/java/org/apache/wicket/markup/html/internal/HtmlHeaderContainer.java
index e906560..99138e4 100644
--- 
a/wicket-core/src/main/java/org/apache/wicket/markup/html/internal/HtmlHeaderContainer.java
+++ 
b/wicket-core/src/main/java/org/apache/wicket/markup/html/internal/HtmlHeaderContainer.java
@@ -66,7 +66,7 @@ import org.apache.wicket.response.StringResponse;
  *  and it's content is copied to the output. 
Components contained in
  *  are rendered as usual
  * 
- * 
+ *
  * @author Juergen Donnerstag
  */
 public class HtmlHeaderContainer extends TransparentWebMarkupContainer
@@ -89,7 +89,7 @@ public class HtmlHeaderContainer extends 
TransparentWebMarkupContainer
/**
 * Combines the {@link MarkupStream} with the open tag, together 
representing the header section
 * in the markup.
-* 
+*
 * @author papegaaij
 */
public static class HeaderStreamState
@@ -122,7 +122,7 @@ public class HtmlHeaderContainer extends 
TransparentWebMarkupContainer
 
/**
 * Construct
-* 
+*
 * @see Component#Component(String)
 */
public HtmlHeaderContainer(final String id)
@@ -161,19 +161,19 @@ public class HtmlHeaderContainer extends 
TransparentWebMarkupContainer
final StringResponse response = new StringResponse();
getRequestCycle().setResponse(response);
 
-   IHeaderResponse headerResponse = getHeaderResponse();
-   if (!response.equals(headerResponse.getResponse()))
-   {
-   
getRequestCycle().setResponse(headerResponse.getResponse());
-   }
+   try (IHeaderResponse headerResponse = 
getHeaderResponse()) {
+   if 
(!response.equals(headerResponse.getResponse()))
+   {
+   
getRequestCycle().setResponse(headerRespo

[jira] [Commented] (WICKET-6617) Header contribution ignore

2018-12-02 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on WICKET-6617:


GitHub user solomax opened a pull request:

https://github.com/apache/wicket/pull/343

[WICKET-6617] headers are added to header-items if specified



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/apache/wicket WICKET-6617-header-placeholder

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/wicket/pull/343.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #343


commit a529aadafdaf7b32e909bbf90fe32822e841877f
Author: Maxim Solodovnik 
Date:   2018-12-02T08:09:37Z

[WICKET-6617] headers are added to header-items if specified




> Header contribution ignore 
> -
>
> Key: WICKET-6617
> URL: https://issues.apache.org/jira/browse/WICKET-6617
> Project: Wicket
>  Issue Type: Bug
>  Components: wicket-core
>Affects Versions: 8.2.0
>Reporter: Maxim Solodovnik
>Assignee: Maxim Solodovnik
>Priority: Major
>
> Components added via AJAX and contributing to  using @Override 
> renderHead ignores  if any



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (WICKET-6617) Header contribution ignore

2018-12-02 Thread Sven Meier (JIRA)


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

Sven Meier commented on WICKET-6617:


Could you improve the issue description? I don't understand what's the issue 
here.

> Header contribution ignore 
> -
>
> Key: WICKET-6617
> URL: https://issues.apache.org/jira/browse/WICKET-6617
> Project: Wicket
>  Issue Type: Bug
>  Components: wicket-core
>Affects Versions: 8.2.0
>Reporter: Maxim Solodovnik
>Assignee: Maxim Solodovnik
>Priority: Major
>
> Components added via AJAX and contributing to  using @Override 
> renderHead ignores  if any



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (WICKET-6617) Header contribution ignore

2018-12-02 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on WICKET-6617:


Github user svenmeier commented on a diff in the pull request:

https://github.com/apache/wicket/pull/343#discussion_r238106752
  
--- Diff: 
wicket-core/src/main/java/org/apache/wicket/markup/html/internal/HtmlHeaderContainer.java
 ---
@@ -161,19 +161,19 @@ public final void onComponentTagBody(MarkupStream 
markupStream, ComponentTag ope
final StringResponse response = new StringResponse();
getRequestCycle().setResponse(response);
 
-   IHeaderResponse headerResponse = getHeaderResponse();
-   if (!response.equals(headerResponse.getResponse()))
-   {
-   
getRequestCycle().setResponse(headerResponse.getResponse());
-   }
+   try (IHeaderResponse headerResponse = 
getHeaderResponse()) {
+   if 
(!response.equals(headerResponse.getResponse()))
+   {
+   
getRequestCycle().setResponse(headerResponse.getResponse());
+   }
 
-   // Render the header sections of all components on the 
page
-   AbstractHeaderRenderStrategy.get().renderHeader(this,
-   new HeaderStreamState(markupStream, openTag), 
getPage());
+   // Render the header sections of all components 
on the page
+   
AbstractHeaderRenderStrategy.get().renderHeader(this,
+   new HeaderStreamState(markupStream, 
openTag), getPage());
 
-   // Close the header response before rendering the 
header container itself
-   // See https://issues.apache.org/jira/browse/WICKET-3728
-   headerResponse.close();
--- End diff --

Why no close() any longer?


> Header contribution ignore 
> -
>
> Key: WICKET-6617
> URL: https://issues.apache.org/jira/browse/WICKET-6617
> Project: Wicket
>  Issue Type: Bug
>  Components: wicket-core
>Affects Versions: 8.2.0
>Reporter: Maxim Solodovnik
>Assignee: Maxim Solodovnik
>Priority: Major
>
> Components added via AJAX and contributing to  using @Override 
> renderHead ignores  if any



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


wicket git commit: WICKET-6616 discard stateless page instance after invoking listener

2018-12-02 Thread adelbene
Repository: wicket
Updated Branches:
  refs/heads/WICKET-6616-render-new-pages 557115433 -> daecc1efe


WICKET-6616 discard stateless page instance after invoking listener

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

Branch: refs/heads/WICKET-6616-render-new-pages
Commit: daecc1efe9bec652d4b3925d15cf16a91e0fa275
Parents: 5571154
Author: Andrea Del Bene 
Authored: Sun Dec 2 22:09:21 2018 +0100
Committer: Andrea Del Bene 
Committed: Sun Dec 2 22:09:21 2018 +0100

--
 .../wicket/core/request/handler/ListenerRequestHandler.java | 5 +
 1 file changed, 5 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/wicket/blob/daecc1ef/wicket-core/src/main/java/org/apache/wicket/core/request/handler/ListenerRequestHandler.java
--
diff --git 
a/wicket-core/src/main/java/org/apache/wicket/core/request/handler/ListenerRequestHandler.java
 
b/wicket-core/src/main/java/org/apache/wicket/core/request/handler/ListenerRequestHandler.java
index 91b8b2a..ebb2020 100644
--- 
a/wicket-core/src/main/java/org/apache/wicket/core/request/handler/ListenerRequestHandler.java
+++ 
b/wicket-core/src/main/java/org/apache/wicket/core/request/handler/ListenerRequestHandler.java
@@ -206,6 +206,11 @@ public class ListenerRequestHandler
}
 
invokeListener(requestCycle, policy, isAjax);
+   
+   if (isAjax && page.isPageStateless())
+   {   
+   pageComponentProvider.detach();
+   }
}
 
private void invokeListener(IRequestCycle requestCycle, RedirectPolicy 
policy, boolean ajax)



[jira] [Commented] (WICKET-6616) Stateless pages are not rendered anymore before executing a behavior

2018-12-02 Thread ASF subversion and git services (JIRA)


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

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

Commit daecc1efe9bec652d4b3925d15cf16a91e0fa275 in wicket's branch 
refs/heads/WICKET-6616-render-new-pages from [~bitstorm]
[ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=daecc1e ]

WICKET-6616 discard stateless page instance after invoking listener

> Stateless pages are not rendered anymore before executing a behavior
> 
>
> Key: WICKET-6616
> URL: https://issues.apache.org/jira/browse/WICKET-6616
> Project: Wicket
>  Issue Type: Bug
>  Components: wicket-core
>Affects Versions: 8.2.0
>Reporter: Thomas Heigl
>Priority: Major
> Attachments: myproject.zip
>
>
> I just upgraded from 8.1.0 to 8.2.0 and a bunch of my tests broke. A required 
> form component on a stateless page that is hidden in "onConfigure" started to 
> report an error after the upgrade.
> The problem was introduced in WICKET-6608 by this commit:
> [https://github.com/apache/wicket/commit/147f6d33f839edd9a6eb53ce9c20b4cde07fc938]
> Previously, the page was initialized *and* rendered before returning the 
> component. Now, for some reason, the page is initialized and the component 
> returned immediately if it exists. This breaks all visibility/enabled 
> conditions that are evaluated later in the life cycle of stateless components.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (WICKET-6617) Header contribution ignore

2018-12-02 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on WICKET-6617:


Github user solomax commented on a diff in the pull request:

https://github.com/apache/wicket/pull/343#discussion_r238121519
  
--- Diff: 
wicket-core/src/main/java/org/apache/wicket/markup/html/internal/HtmlHeaderContainer.java
 ---
@@ -161,19 +161,19 @@ public final void onComponentTagBody(MarkupStream 
markupStream, ComponentTag ope
final StringResponse response = new StringResponse();
getRequestCycle().setResponse(response);
 
-   IHeaderResponse headerResponse = getHeaderResponse();
-   if (!response.equals(headerResponse.getResponse()))
-   {
-   
getRequestCycle().setResponse(headerResponse.getResponse());
-   }
+   try (IHeaderResponse headerResponse = 
getHeaderResponse()) {
+   if 
(!response.equals(headerResponse.getResponse()))
+   {
+   
getRequestCycle().setResponse(headerResponse.getResponse());
+   }
 
-   // Render the header sections of all components on the 
page
-   AbstractHeaderRenderStrategy.get().renderHeader(this,
-   new HeaderStreamState(markupStream, openTag), 
getPage());
+   // Render the header sections of all components 
on the page
+   
AbstractHeaderRenderStrategy.get().renderHeader(this,
+   new HeaderStreamState(markupStream, 
openTag), getPage());
 
-   // Close the header response before rendering the 
header container itself
-   // See https://issues.apache.org/jira/browse/WICKET-3728
-   headerResponse.close();
--- End diff --

`close()` is being called automatically by `try with resource` statement
I'll modify comment


> Header contribution ignore 
> -
>
> Key: WICKET-6617
> URL: https://issues.apache.org/jira/browse/WICKET-6617
> Project: Wicket
>  Issue Type: Bug
>  Components: wicket-core
>Affects Versions: 8.2.0
>Reporter: Maxim Solodovnik
>Assignee: Maxim Solodovnik
>Priority: Major
>
> Components added via AJAX and contributing to  using @Override 
> renderHead ignores  if any



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (WICKET-6617) Header contribution ignore

2018-12-02 Thread Maxim Solodovnik (JIRA)


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

Maxim Solodovnik updated WICKET-6617:
-
Description: 
Components added via AJAX and contributing to {{}} using {{@Override 
renderHead}} ignores {{}} if any

Here is the example:
Imaging you have following markup:
{code}

  

Hello
  
  
  
  

{code}

In your java code you replacing component A with component B on the page via 
AJAX
Component B contributing to {{}} as follows:
{code}
@Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
response.render(JavaScriptHeaderItem.forReference(new 
JavaScriptResourceReference(B.class, "some.js")));
}
{code}

As developer I would expect additional JS/CSS files (or any other header 
resources) will be appended before {{}} tag since I have placed 
{{}} tag

Currently only initial header resources will take {{}} 
into account

  was:Components added via AJAX and contributing to  using @Override 
renderHead ignores  if any


> Header contribution ignore 
> -
>
> Key: WICKET-6617
> URL: https://issues.apache.org/jira/browse/WICKET-6617
> Project: Wicket
>  Issue Type: Bug
>  Components: wicket-core
>Affects Versions: 8.2.0
>Reporter: Maxim Solodovnik
>Assignee: Maxim Solodovnik
>Priority: Major
>
> Components added via AJAX and contributing to {{}} using {{@Override 
> renderHead}} ignores {{}} if any
> Here is the example:
> Imaging you have following markup:
> {code}
> 
>   
> 
> Hello
>   
>   
>   
>   
> 
> {code}
> In your java code you replacing component A with component B on the page via 
> AJAX
> Component B contributing to {{}} as follows:
> {code}
>   @Override
>   public void renderHead(IHeaderResponse response) {
>   super.renderHead(response);
>   response.render(JavaScriptHeaderItem.forReference(new 
> JavaScriptResourceReference(B.class, "some.js")));
>   }
> {code}
> As developer I would expect additional JS/CSS files (or any other header 
> resources) will be appended before {{}} tag since I have placed 
> {{}} tag
> Currently only initial header resources will take {{}} 
> into account



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


wicket git commit: [WICKET-6617] comment regarding auto-close is improved

2018-12-02 Thread solomax
Repository: wicket
Updated Branches:
  refs/heads/WICKET-6617-header-placeholder a529aadaf -> b83281403


[WICKET-6617] comment regarding auto-close is improved


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

Branch: refs/heads/WICKET-6617-header-placeholder
Commit: b83281403a30c6bcfd7c9a3c751ae1851cea2126
Parents: a529aad
Author: Maxim Solodovnik 
Authored: Mon Dec 3 09:39:58 2018 +0700
Committer: Maxim Solodovnik 
Committed: Mon Dec 3 09:39:58 2018 +0700

--
 .../apache/wicket/markup/html/internal/HtmlHeaderContainer.java| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/wicket/blob/b8328140/wicket-core/src/main/java/org/apache/wicket/markup/html/internal/HtmlHeaderContainer.java
--
diff --git 
a/wicket-core/src/main/java/org/apache/wicket/markup/html/internal/HtmlHeaderContainer.java
 
b/wicket-core/src/main/java/org/apache/wicket/markup/html/internal/HtmlHeaderContainer.java
index 99138e4..ebe0de3 100644
--- 
a/wicket-core/src/main/java/org/apache/wicket/markup/html/internal/HtmlHeaderContainer.java
+++ 
b/wicket-core/src/main/java/org/apache/wicket/markup/html/internal/HtmlHeaderContainer.java
@@ -171,7 +171,7 @@ public class HtmlHeaderContainer extends 
TransparentWebMarkupContainer

AbstractHeaderRenderStrategy.get().renderHeader(this,
new HeaderStreamState(markupStream, 
openTag), getPage());
 
-   // Close the header response before rendering 
the header container itself
+   // Header response will be auto-closed before 
rendering the header container itself
// See 
https://issues.apache.org/jira/browse/WICKET-3728
};
 



[jira] [Commented] (WICKET-6617) Header contribution ignore

2018-12-02 Thread ASF subversion and git services (JIRA)


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

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

Commit b83281403a30c6bcfd7c9a3c751ae1851cea2126 in wicket's branch 
refs/heads/WICKET-6617-header-placeholder from [~solomax]
[ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=b832814 ]

[WICKET-6617] comment regarding auto-close is improved


> Header contribution ignore 
> -
>
> Key: WICKET-6617
> URL: https://issues.apache.org/jira/browse/WICKET-6617
> Project: Wicket
>  Issue Type: Bug
>  Components: wicket-core
>Affects Versions: 8.2.0
>Reporter: Maxim Solodovnik
>Assignee: Maxim Solodovnik
>Priority: Major
>
> Components added via AJAX and contributing to {{}} using {{@Override 
> renderHead}} ignores {{}} if any
> Here is the example:
> Imaging you have following markup:
> {code}
> 
>   
> 
> Hello
>   
>   
>   
>   
> 
> {code}
> In your java code you replacing component A with component B on the page via 
> AJAX
> Component B contributing to {{}} as follows:
> {code}
>   @Override
>   public void renderHead(IHeaderResponse response) {
>   super.renderHead(response);
>   response.render(JavaScriptHeaderItem.forReference(new 
> JavaScriptResourceReference(B.class, "some.js")));
>   }
> {code}
> As developer I would expect additional JS/CSS files (or any other header 
> resources) will be appended before {{}} tag since I have placed 
> {{}} tag
> Currently only initial header resources will take {{}} 
> into account



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)