// Put Javascript into body after compoonent
        @Override
        protected void onComponentRendered() {
                super.onComponentRendered();

                JavascriptUtils.writeJavascript(response, <<our javascript>);
        }

or

        // put Javascript into head
        @Override
        public void renderHead(IHeaderResponse response) {
                super.renderHead(response);

                response.renderJavascript(builder.toScriptTag(), null);
        }

Your javascript should look like

        this.getCallbackUrl() + "&myParam='" + myValue + "'";


        @Override
        protected void respond(final AjaxRequestTarget target) {
                Component component = getComponent();
                Request request;
                if (component != null && (request = component.getRequest()) != 
null) {
                        String myPAram = request.getParameter("myParam");
                // do some processing on component
        }

Stefan


-----Ursprüngliche Nachricht-----
Von: [email protected] [mailto:[email protected]] Im Auftrag 
von pieter claassen
Gesendet: Mittwoch, 18. November 2009 13:04
An: [email protected]
Betreff: javascript slider implementation

I would like to implement a slider to set the width of a component.

I could not get the Dojo Slider implementation working with wicket 1.4.1 (I
could not get the code in with maven even though the Dojo project built from
SVN, it just doesn't seem to contain the Slider class anymore).

My thinking is to build a very simple slider component that updates a
variable and on mouse-up returns this data to the server.

My approach so far is:
1. Implement my own SliderAbstractAjaxBehavior that in onRequest will accept
the current position of the slider.
2. I will then update the width of my component and mark it for repainting.
3. I will have to develop the javascript to read the slider values and react
to the mouseup event. Where can I look for more information on how to post
data back to onRequest from Javascript? I assume there is a function already
availble in the standard wicket JS implementation?

Any tips appreciated.

Rgds,
Pieter

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to