[Seaside] WAComponent callbacks, continuations and #children
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
>> 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:
> ^ 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:
> ^ 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.
Thank you for your assistance, I was gload to be of service (and glad I
was not going insane!)
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