[Seaside] WAComponent callbacks, continuations and #children

John Thornborrow john at pinesoft.co.uk
Fri Jun 8 08:52:03 UTC 2007


Lukas Renggli wrote:
>> !BrokenExample methodsFor: 'as yet unclassified' stamp: 'JMT 6/7/2007
>> 14:33'!
>> initialize
>>         menu _ MenuContainer new root: self.
>>         registry _ (Dictionary new
>>                 at: 'content' put: (ContentContainer new root: self);
>>                 yourself)! !
>
> 1. Always call super initialize. I know this works in 2.7, but it
> breaks in 2.8.
>
> 2. Register all the objects that reference components that are
> returned as children for backtracking.
>
> This means you need to add the following two lines to the end of your
> initialize method in 2.7:
>
>    self session
>        registerObjectForBacktracking: registry;    " for the dictionary "
>        registerObjectForBacktracking: self           " for the menu "
>
> In 2.8 this is simpler, you implement the message #states to answer
> the objects to be backtracked:
>
>    states
>        ^ Array with: registry with: self
>
> 3. Thanks to your question I found another severe bug in the
> backtracking of dictionaries (there was a long undiscovered one in
> Set, but obviously this was not the end). This is fixed and tested
> against in 2.8. For 2.7 make sure that you have these two methods:
>
>    Set>>snapshotCopy
>        ^ self copy
>
>    Dictionary>>restoreFromSnapshot: aDictionary
>        self keys do: [ :key | self removeKey: key ].
>        aDictionary keysAndValuesDo: [ :key :value | self at: key put:
> value ]
>
> Considering all this makes your example work.
>
> Thanks for providing the example that lead to a solution to this bug.
>
> Lukas
>
Thank you for your assistance, I was gload to be of service (and glad I
was not going insane!)

Much obliged,
John
www.pinesoft.co.uk


Pinesoft Computers are registered in England, Registered number: 2914825. Registered office: 266-268 High Street, Waltham Cross, Herts, EN8 7EA



This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com



More information about the Seaside mailing list