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

Martin Grigorov commented on WICKET-4000:
-----------------------------------------

I see you are confused.

If a component depends on JS library then the component should add a reference 
for it. It should not expect that the page that uses this component will 
provide it. The component can implement means to switch off the contribution or 
to override the ResourceReference if it wants, so it will be possible to use 
different version of the JS library.

The page contribution should come after the components so that even if the 
component library doesn't provide ways to switch off/replace the contribution 
then the page can still override it. This is more valid for CSS contributions 
and less for JS ones.
As final resort Wicket provides IHeaderResponseDecorator hook so you are able 
to suppress any ResourceReference you want.

Additionally there are Application scoped IHeaderContributor's which will 
render their CSS/JS for all pages and always before the pages/components.

The only difference between 1.4 and 1.5 if that components now contribute 
before the page. That's all. There are no differences in wicket:head vs. 
renderHead() order.
Additionally there is no sense to use wicket:head in the base Page. It is for 
Panels and Borders and inherited Pages. In the base page you can (and should) 
use <head>.

About Java constructors: it is the same in Wicket.
wicket:head order in the quickstart: 3 (BasePage.html) and then 8, 9 
(HomePage.html)
renderHead order: 1, 2 (BasePage.java) and then 6, 7 (HomePage.java)

As I said earlier the only one that looks out of order is the Panel 
contribution. I expect 5 (Header.html) and 4 (Header.java) to be the first two 
in the line, not in the middle as now. 

1.5.0 is already voted so it is not possible to shuffle them more for 1.5.x 
thus the ticket is moved to 1.6.x.

> Header contributions order is not stable
> ----------------------------------------
>
>                 Key: WICKET-4000
>                 URL: https://issues.apache.org/jira/browse/WICKET-4000
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5-RC6
>            Reporter: Sylvain Vieujot
>             Fix For: 1.6.0
>
>         Attachments: quickstart-scriptsOrder.zip
>
>
> In the last RCs, I started to experience problems with the contributions 
> order.
> For example, I add jQuery, and until 1.5RC5, it worked well, but now the call 
> to the jQuery script has been moved to the bottom of the page head, and this 
> disables all my other scripts that are expecting jQuery's $ to be defined.
> I attach a quickstart to demonstrate the problem.
> Maybe the order in the quickstart is not the expected one, but what it shows 
> is that the order does not make real sense (at least to me) :
> In the quickstart, the wicket:head tag contributions are in the order 3 - 8 - 
> 9 - 5, and the renderHead methods contributions are in the order 4 - 1 - 2 - 
> 6 - 7.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to