Re: javascript slider implementation

2009-11-19 Thread Martin Grigorov
Does the jquery demo work for you ?
If YES then the problem is somewhere in your code,
if NO then something went wrong somewhere in the library itself :-) 

On Thu, 2009-11-19 at 08:46 +0100, pieter claassen wrote:
 Hi Martin,
 
 I tried to implement your Slider suggestion but even if I duplicate
 the code in the examples, I get no feedback to the onChange method. My
 ajax debug console also shows nothing so I get the feeling I am
 missing  some javascript code here.
 
 I have the jquery-1.4-SNAPSHOT.jar (1.4-20091110.07192) installed (I
 am using wicket 1.4.1)
 
 Any suggestions?
 
 Rgds,
 Pieter
 
 On Wed, Nov 18, 2009 at 1:51 PM, Martin Grigorov mcgreg...@e-card.bg
 wrote:
 check wicketstuff-jquery
 there is a slider behavior + demo
 
 
 On Wed, 2009-11-18 at 13:04 +0100, pieter claassen wrote:
  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: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
 
 -- 
 Pieter Claassen
 musmato.com



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



javascript slider implementation

2009-11-18 Thread pieter claassen
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


RE: javascript slider implementation

2009-11-18 Thread Stefan Lindner
// 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: pieter.claas...@gmail.com [mailto:pieter.claas...@gmail.com] Im Auftrag 
von pieter claassen
Gesendet: Mittwoch, 18. November 2009 13:04
An: users@wicket.apache.org
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: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: javascript slider implementation

2009-11-18 Thread Martin Grigorov
check wicketstuff-jquery
there is a slider behavior + demo

On Wed, 2009-11-18 at 13:04 +0100, pieter claassen wrote:
 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: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: javascript slider implementation

2009-11-18 Thread pieter claassen
Thanks, this helped a lot.

My component that I want to resize is a WebMarkupContainer and I add my
Slider to it. However, I don't see any output from my onChange method.

here is the java and html. I am not sure what role SliderOptions and
SliderHandleOptions play? Where can I see some example implementations?

Slider slider=new Slider(slider, new
SliderOptions().setMax(100).setMin(0),new SliderHandleOptions(1, 50)) {

@Override
public void onChange(AjaxRequestTarget arg0, String handleid,
int val) {
System.out.println(SLIDER STUFF : +handleid+val);
}
};
add(holder);
holder.add(slider);

html
span class=questionholder wicket:id=holder
a href=# wicket:id=editor(edit)/a
span id=value wicket:id=statement.value/
span wicket:id=navpanel /
span wicket:id=slider/
/span


On Wed, Nov 18, 2009 at 1:51 PM, Martin Grigorov mcgreg...@e-card.bgwrote:

 check wicketstuff-jquery
 there is a slider behavior + demo

 On Wed, 2009-11-18 at 13:04 +0100, pieter claassen wrote:
  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: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




-- 
Pieter Claassen
musmato.com


Re: javascript slider implementation

2009-11-18 Thread pieter claassen
Hi Martin,

I tried to implement your Slider suggestion but even if I duplicate the code
in the examples, I get no feedback to the onChange method. My ajax debug
console also shows nothing so I get the feeling I am missing  some
javascript code here.

I have the jquery-1.4-SNAPSHOT.jar (1.4-20091110.07192) installed (I am
using wicket 1.4.1)

Any suggestions?

Rgds,
Pieter

On Wed, Nov 18, 2009 at 1:51 PM, Martin Grigorov mcgreg...@e-card.bgwrote:

 check wicketstuff-jquery
 there is a slider behavior + demo

 On Wed, 2009-11-18 at 13:04 +0100, pieter claassen wrote:
  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: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




-- 
Pieter Claassen
musmato.com