[Seaside] Question about Section 12.2 of the Seaside book

John McKeon 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.
>
>  IAddress>>initialize
> 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.
>
> IAddress>>save
> Contact removeContact: contactCurrentlyBeingEdited; addContact: editor
> contact
>
> IAddress>>cancel
> self editContact: contactCurrentlyBeingEdited.
>
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>


-- 
http://john-mckeon.us
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20101023/6ef221e3/attachment.htm


More information about the seaside mailing list