[Seaside] I do not understand how I have to interpret this code

Bob Arning arning at charm.net
Thu Nov 25 21:05:19 UTC 2010


One thing to look out for is:

WAExampleBrowser>>allClasses(b is shadowed)

Cheers,
Bob

On 11/25/10 3:45 PM, Marten Feldtmann wrote:
> I have problems in understanding this code. It is from the 
> WAExampleBrowser. I added an additional instance variable b to this 
> class and changed the following methods.
>
> |initialize
>    super initialize.
>    self class: self allClasses first.
>    b := 5.|
>
> |renderChooserOn: html
>    b := 12.
>    html div class: 'chooser'; with: [
>       html form: [
>          html div: [
>             html select
>                selected: class;
>                list: self allClasses;
>                onChange: 'submit()';
>                callback: [ :value | self halt. self class: value ] ] ].
>       self allSelectors size > 1 ifTrue: [
>          html form: [
>             html div: [
>                html select
>                   selected: selector;
>                   list: self allSelectors;
>                   onChange: 'submit()';
>                   callback: [ :value | self selector: value ] ] ] ] ]
>
> The question is: What is the value of instance variable "b" of the 
> receiver at the location of "self halt".
>
> The answer is: 5 - but why !? what state of the instance do I see in 
> the callback ?
>
> |I know that the Seaside book tells one: "Your rendering method is 
> just for painting the current state of your component, it shouldn't be 
> concerned with changing that state".
>
>
>
> _______________________________________________
> 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/20101125/08246478/attachment.htm


More information about the seaside mailing list