[8.0.2] Seaside - Ouch, ouch, ouch ...

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

[8.0.2] Seaside - Ouch, ouch, ouch ...

Postby marten » Thu Nov 25, 2010 11:33 am

The things are getting stranger and stranger .... let us assume, that I have an instance of a subclass of WAComponent. And within this instance I've defined several instance variables: a, b, c.

Code: Select all
renderContentOn: html
....
html form: [
  html select
  list:  ... ;
  selected: ... ;
  onChange: 'submit()';
  callback: [ :value | self a: value ].
].
...


Now we assume, that instance variable "b" and "c" of the receiver are set within this method. "a" is not set. But - due to browser activities - somewhere later the user selects an item and the callback is executed and "a" gets a value (somewhere in the future).

After the execution of this callback the renderContentOn: method is executed again, BUT NOW at the beginning of this method variable "b" and "c" are NOT set and only variable "a" is set.

That is not, what I would expect .... or should I ?
Marten Feldtmann, Principal Smalltalk User, Private
SkypeMe callto://marten.feldtmann
marten
[|]
 
Posts: 641
Joined: Sat Oct 14, 2006 7:10 am
Location: Hamburg - Germany

Re: [8.0.2] Seaside - Ouch, ouch, ouch ...

Postby marten » Thu Nov 25, 2010 12:22 pm

It seems to be the normal behaviour. You might look at the WAExampleBrowser and add a new instance variable "b" to this class and then change the methods

Code: Select all
initialize
   super initialize.
   self class: self allClasses first.
   b := 5.


Code: Select all
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: When the code reaches self halt. What is the content of b !?

Answer: 5 (the same on Pharo, VA and VW) !!!!
Marten Feldtmann, Principal Smalltalk User, Private
SkypeMe callto://marten.feldtmann
marten
[|]
 
Posts: 641
Joined: Sat Oct 14, 2006 7:10 am
Location: Hamburg - Germany


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron