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

Marten Feldtmann itlists at schrievkrom.de
Thu Nov 25 20:45:33 UTC 2010


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".


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20101125/7071ae02/attachment.htm


More information about the seaside mailing list