Hi wickers !

I've a problem with wicket and jquery resource rendering.

My webpage has many panels wich uses jquery, and they have javascript attached 
to it. 
This panel-dependant javascript uses jquery, so I render jquery with a 
resourcerefernce in the webpage. 
(The page doesn't use ajax because I want to mantain page stateless and 

The problem is that the javascript attached to panel is rendered first into the 
page, and the jquery reference is the last. 
so, when the page fully renders, i've some 'ReferenceError: $ is not defined' 
errors in webrowser console.

¿ Has anyone experienced similar problems ?

Other little question: wicket6 uses jquery 1.7.2; has anyone tried with 1.8.x ?

Thanks in advance

    > > > Oscar Besga Arcauz  < < < 


Example code (little long) --->

public class MyPage extends WebPage {

    public MyPage (PageParameters parameters) {
        add(new MyPageJsBehaviour());
        add(new MyPanel("mypanel"));

    private class MyPageJsBehaviour extends Behavior {

            public void renderHead(Component component, IHeaderResponse 
response) {                


public class MyPanel extends Panel {

    public MyPanel(String id,String lang) {
        add(new MyPanelJsBehaviour());

    private class MyPanelJsBehaviour extends Behavior {

            public void renderHead(Component component, IHeaderResponse 
response) {
JavaScriptResourceReference(MyPanel .class, "MyPanel.js"),"mypaneljs"));
                $(function () { // <-- here arises the error, as $ is not 
defined because MyPanel.js is loaded before jquery !!!


To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to