[Seaside] Question about Section 12.2 of the Seaside book
p3anoman at gmail.com
Sat Oct 23 15:28:33 UTC 2010
Wow I stand corrected. I had no idea you could answer: from a component that
hadn't been called. You learn something new every day.
Back to reading....
On Fri, Oct 22, 2010 at 9:02 PM, Elliot Finley <efinley.lists at gmail.com>wrote:
> On Fri, Oct 22, 2010 at 6:37 PM, John McKeon <p3anoman at gmail.com> wrote:
>> On Fri, Oct 22, 2010 at 8:31 PM, Elliot Finley <efinley.lists at gmail.com>wrote:
>>> This means the editor needs to operate on a copy of the object.
>> Yes, and the only place you can put code to deal with the copy is in the
>> button callbacks. In this configuration though, answer: is of no use. You
>> would need to do something else...
>>> This is how I did it. I'm a Smalltalk beginner, so there is probably a
> much better way.
> super initialize.
> editor := ContactView new.
> self editContact: self contacts first.
> editor onAnswer: [ :answer | answer ifTrue: [ self save ] ifFalse: [ self
> cancel ] ]
> IAddress>>editContact: aContact
> contactCurrentlyBeingEdited := aContact.
> editor contact: aContact copy.
> Contact removeContact: contactCurrentlyBeingEdited; addContact: editor
> self editContact: contactCurrentlyBeingEdited.
> seaside mailing list
> seaside at lists.squeakfoundation.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the seaside