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

radoslav hodnicak rh at 4096.sk
Thu Nov 25 20:58:20 UTC 2010


Backtracking? Try to delete the #states method from the class to see
if it makes any difference.

rado

On Thu, Nov 25, 2010 at 9:45 PM, Marten Feldtmann
<itlists at schrievkrom.de> 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
>
>


More information about the seaside mailing list