But removing and adding a copy is not ideal because other places (other pages in the session even) might be still holding onto the original version. Object identity is pretty important in an object system.<br><br>Certainly making a copy to edit is a fairly common pattern but anytime I've done it, we would copy the modified values back to the original on save (or use a read-through proxy instead).<br>
<br>Julian<br><br><div class="gmail_quote">On Mon, May 10, 2010 at 2:00 PM, Sean Allen <span dir="ltr"><<a href="mailto:sean@monkeysnatchbanana.com">sean@monkeysnatchbanana.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
>From looking at the code, I'm not sure how you would lose a reference to<br>
the ordered collection of contacts. Is it a class variable or<br>
instance variable?<br>
<div class="im"><br>
<br>
2010/5/10 José Perez <<a href="mailto:asertus@gmail.com">asertus@gmail.com</a>>:<br>
</div><div><div></div><div class="h5">> Basically in the initial (chapter 11) shows how to build a list of<br>
> contacts, and edit them, in a different page 1 by 1. Then it shows how<br>
> to handle the answer, if the user presses "save" or "cancel".<br>
><br>
> What it does is editing a "copy" of the contact, and if the user<br>
> presses "save", then the copy replaces the original contact. If<br>
> "cancel" does nothing.<br>
><br>
> In chapter 12 it shows how to "embed" an editor under the list.<br>
> Editing the contact in the same page.., and it works..., but editing<br>
> the "actual" contact. So, if you press save or cancel, the contact is<br>
> always updated...<br>
><br>
> There it is where I tried to implement the same "behavior" for the<br>
> "cancel" button...<br>
><br>
> Regards...<br>
> _______________________________________________<br>
> seaside mailing list<br>
> <a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br>
> <a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
><br>
_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
</div></div></blockquote></div><br>