SUSlider & SUPeriodical

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

SUSlider & SUPeriodical

Udo Schneider
Hi,

is there a way to combine SUSlider with an SUPeriodical? What I want to
achieve is to display a (changeable) slider which also gets updated from
the server side if neccesarry. I tried to combine SUSlider with an
SUPeriodical but didn't get it to work. I have to admit that I do not
really see the connection points neither. Any help?

CU,

Udo

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: SUSlider & SUPeriodical

Lukas Renggli
> is there a way to combine SUSlider with an SUPeriodical? What I want to
> achieve is to display a (changeable) slider which also gets updated from
> the server side if neccesarry. I tried to combine SUSlider with an
> SUPeriodical but didn't get it to work. I have to admit that I do not
> really see the connection points neither. Any help?

Did you tell the SUPeriodical to evaluate scripts by sending
evalScripts: true. Btw, the latest version of Seaside does this
automatically, even-though this is different in the JavaScript
documentation.

If that doesn't help, maybe you want to post some code so that we can
see what you are trying to do and why it doesn't work?

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: SUSlider & SUPeriodical

Udo Schneider
Lukas Renggli wrote:
> Did you tell the SUPeriodical to evaluate scripts by sending
> evalScripts: true. Btw, the latest version of Seaside does this
> automatically, even-though this is different in the JavaScript
> documentation.
evalScripts: brought some help at least.

> If that doesn't help, maybe you want to post some code so that we can
> see what you are trying to do and why it doesn't work?
I'm still having two problems
1) two sliders appear on the website and both are functional
I assume there is a conflict between the initial render using with
and subsequent renders from the updater. But I can't quite get what
to do.

2) only the first slider gets updated on a regular basis and allways
flickers when doing that. It seems that the whole div is redrawn
everytime including the silder being in zero position initially.

This is the code I use (Counter is simply a global variable with
a value from 1-100):

Thanks,

Udo



renderContentOn: html
        html paragraph script: (html periodical frequency: 2 seconds;
                         on: #renderSliderOn: of: self;
                         evalScripts: true);
               
                with: [self renderSliderOn: html]

renderSliderOn: html
        html div id: 'track';
               
                with: [html div id: 'handle'].
        html script: (html slider handleId: 'handle';
                         trackId: 'track';
                         value: Counter;
                       
                        range: (0 to: 100);
                       
                        onChange: (html updater
                                        triggerSliderCallback: [:value | Counter := value asInteger]))

style
        ^ 'div#track {
    width: 200px; height: 5px;
    background-color: #eee;
}
div#handle {
    width: 5px; height: 10px;
    background-color: #e8a400;
    cursor: move;
}'

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: SUSlider & SUPeriodical

Udo Schneider
Udo Schneider wrote:
> 1) two sliders appear on the website and both are functional
> I assume there is a conflict between the initial render using with
> and subsequent renders from the updater. But I can't quite get what
> to do.
I solved the first problem by having an empty #with:

> 2) only the first slider gets updated on a regular basis and allways
> flickers when doing that. It seems that the whole div is redrawn
> everytime including the silder being in zero position initially.
Any hint on this?

Just out of curiosity ... how to I update several Elements based on
Periodical updates? Let's say a slider at the top and an number at the
bottom of a page?

CU,

Udo

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Re: SUSlider & SUPeriodical

Lukas Renggli
> Just out of curiosity ... how to I update several Elements based on
> Periodical updates? Let's say a slider at the top and an number at the
> bottom of a page?

Have a look at #evaluator and friends, search in the image and the
mailing list for senders of this message. The SUEvaluator allows to
inject scripts into an existing page. You can update multiple parts of
a page, modify the dom tree, trigger callbacks, effects, etc.

To trigger an SUEvaluator periodically use the #every: message to add
a decorator.

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: SUSlider & SUPeriodical

Udo Schneider
Lukas Renggli wrote:
> Have a look at #evaluator and friends, search in the image and the
> mailing list for senders of this message. The SUEvaluator allows to
> inject scripts into an existing page. You can update multiple parts of
> a page, modify the dom tree, trigger callbacks, effects, etc.
>
> To trigger an SUEvaluator periodically use the #every: message to add
> a decorator.
I'll take a look into that. Thanks for your help.

CU,

Udo

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside