Hello,

You need to use a behaviour in your panel to emit the javascript.

panel.setOutputMarkupId (true);
panel.setOutputMarkupIdPlaceholder(true);

panel.add(new AbstractBehaviour () {


    public void renderHead(IHeaderResponse response)
    {
// markupid is determined for this panel before it is rendered so it is available here
            //
            StringBuffer javascriptBuffer = new StringBuffer();

javascriptBuffer.append ("$('"+panel.getMarkupId()+"').slider('option','value',"+expLevVal+");");

response.response.renderOnLoadJavascript(javascriptBuffer.toString());

    }
});

This will emit the action into the header of the page and it will run once the page is loaded and the DOM has been built.

Regards,

Mike
Hi,

I have a panel that sets some properties at its constructor. Then I want to
use one of this properties to set a javascript slider, so I need to call
javascript code like
"$('#slider').slider('option','value',"+expLevVal+");"
I know how I can do this when I have some event, like link or button click,
but how about the calling set method or after construction of the class.

Thanks


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

Reply via email to