[Seaside] Following chapter 12.2 and encountering difficulties with my interpretation of

Fritz Schenk intrader.intrader at gmail.com
Fri Apr 22 01:05:12 UTC 2011


chapter 11.5 handling of the Cancel button.
1. A first try at following 11.5 fails when a second click on the Cancel button 
results in "Error: Object is not in the collection.";  I am deleting aContact a
 second time. The copy is indeed added to the collection but it does not 
replace the collection entry corresponding to where aContact was obtained.
2. Further the editor subcomponent does not revert to its original state.
3. The list component is not updated when the contact name is changed.
It appears that the callback containing the editor reference should be updated.
A possible solution would be to deep copy the copy reference back into the 
aContact reference and do not remove the aContact entry.

I need help in understanding how to properly handle Cancel when embedded 
components are involved.
The code I have in the editContact method is
<code>
editContact: aContact
	| copy |
	copy := aContact copy.
	(editor contact: aContact) onAnswer: [ :answer |
		answer ifFalse: [
			"aContact has changed contact regardless of whether 
editor answers true or false;
			 copy has the original"
			MyContact removeContact: aContact.
			MyContact addContact: copy.
			"the editor view still has changed value; the view 
should be rerendered with original value (the copy)".
			] 
</code>



More information about the seaside mailing list