[Seaside] JQuery UI slider updates textfied and textfield updates slider: how to?

radoslav hodnicak rh at 4096.sk
Fri Aug 27 18:00:30 UTC 2010


and if you wonder how to display the values of a range slider while you drag
the gizmo, a snipped of my code:

html div script: (html jQuery new slider
    values: (Array with: from with: to);
    range: true;
    min: 0;
    max: 100;
    step: 5;
    onSlide: (JSFunction new
             add: ((html jQuery id: fromId) value: (html jQuery this slider
getValueAt: 0));
             add: ((html jQuery id: toId) value: (html jQuery this slider
getValueAt: 1));
             yourself)
     ).

jquery in seaside is fun

On Fri, Aug 27, 2010 at 12:19 PM, Lukas Renggli <renggli at gmail.com> wrote:

> On 27 August 2010 11:34, Lawson English <lenglish5 at cox.net> wrote:
> >  I'm trying to connect the display of slider values to text input sorta
> like
> > the demos on the JQueryUI site, but I can't get the connection to go both
> > ways. Changing the value in the text field and pressing return will reset
> > the slider position, but changing the slider position doesn't update the
> > text field.
>
> You don't tell it to update the text field.
>
> > MyTestSlider>>renderContentOn: html
> >    self renderExplanationOn: html.
> > html form: [
> >          html text: 'slider value here: '.
> >      html textInput
> >         value: self current;
> >    callback: [ :value | self current: value ].
> >   html div script: (html jQuery new slider
> >      value: self current;
> >      onStop: (html jQuery ajax
> >  callback: [ :value | self current: value asNumber ]
> > value: (html jQuery this slider getValue))
>
> Try to add something along the following lines to your onStop: event:
>
>   , ((html jQuery id: 'id-of-your-textfield) value: html jQuery this
> slider getValue)
>
> Lukas
>
> --
> Lukas Renggli
> www.lukas-renggli.ch
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20100827/d9a6f18e/attachment.htm


More information about the seaside mailing list