[Seaside] Re: really simple JQuery slider/widget example without
the support of the test classes?
Lawson English
lenglish5 at cox.net
Wed Aug 4 07:03:42 UTC 2010
On 8/3/10 11:29 PM, Andreas Raab wrote:
> On 8/3/2010 11:14 PM, Lukas Renggli wrote:
>> You can copy and paste that example, there are no other dependencies
>> but the inst-var 'current' that you should initialize with a number.
>
> I think he might be looking for this:
>
> http://book.seaside.st/book/getting-started/pharo-squeak/first-component/registering
>
>
> I ran into the same issue; it is decided non-obvious that the creation
> of a component on the welcome page "magically" works but that there's
> no trace in the resulting code that reveals what one must do to to
> perform the equivalent action in code somewhere (i.e., if you create
> the very same class by hand "it doesn't work").
>
> I do understand why this stuff works the way it works but I think
> clarity could be dramatically improved by having something that makes
> the necessary registration explicit. Could be as simple as having the
> registration in the class initialization of components created on the
> welcome page - I certainly would've found that.
>
> Cheers,
> - Andreas
>
I'm afraid I did that. :-(
WAAdmin register: WebCounter asApplicationAt: 'webcounter'.
WAAdmin register: ExampleJQSlider asApplicationAt: 'exampleslider'.
WebCounter initialize.
ExampleJQSlider initialize.
the webcounter app works.
the exampleslider app has the error:
WAToolDecoration(Object)>>doesNotUnderstand: #setOwner:
fileout:
'From Squeak4.1 of 17 April 2010 [latest update: #9957] on 3 August 2010
at 11:48:53 pm'!
JQSlider subclass: #ExampleJQSlider
instanceVariableNames: 'count current'
classVariableNames: ''
poolDictionaries: ''
category: 'JQuery-Examples'!
!ExampleJQSlider methodsFor: 'initialization' stamp: 'LDE 8/3/2010 21:50'!
initialize
super initialize.
current := 50! !
!ExampleJQSlider methodsFor: 'rendering' stamp: 'LDE 8/3/2010 23:30'!
renderContentOn: html
html div script: (html jQuery new slider
value: current;
onChange: (html jQuery ajax
callback: [ :value | current := value asNumber ]
value: (html jQuery this slider getValue)))
! !
"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!
ExampleJQSlider class
instanceVariableNames: ''!
!ExampleJQSlider class methodsFor: 'class initialization' stamp: 'LDE
8/3/2010 23:31'!
initialize
WAAdmin register: self asApplicationAt: 'exampleslider'! !
ExampleJQSlider initialize!
On 8/3/10 11:14 PM, Lukas Renggli wrote:
> You can copy and paste that example, there are no other dependencies
> but the inst-var 'current' that you should initialize with a number.
>
> Lukaa
>
> On Wednesday, August 4, 2010, Lawson English<lenglish5 at cox.net> wrote:
>> can anyone point to me a REALLY simple transitional example on how to
>> implement a JQuery slider? Something along the lines of the
>> webcoiunter example in the seaside book that holds my hand the entire
>> way?
>>
>> something like
>> http://demo.seaside.st/javascript/jquery-ui/sliderwidget with the
>> detail of http://www.seaside.st/about/examples/counter
>> [
>> I can't figure out how to apply the
>> JQSliderFunctionalTest>>renderContentOn: method to something that
>> doesn't have the infrastructure of the test class hierarchy behind it.
>>
>>
>> MyTestSlider>>renderContentOn: html
>> html div script: (html jQuery new slider
>> value: current;
>> onChange: (html jQuery ajax
>> callback: [ :value | current := value asNumber ]
>> value: (html jQuery this slider getValue)))
>>
>> doesn't work as I haven't a clue what extra methods are required to
>> implement the functionality of the example and I can't wrap my head
>> about the multiple layers of the hierarchy to figure out how the
>> different widgets are plugged into the sample page...
>>
>>
>>
>> Thanks.
>>
>>
>> Lawson
>> _______________________________________________
>> 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/20100804/ce8f3ebe/attachment-0001.htm
More information about the seaside
mailing list