[Seaside] Trouble with undo on Record Editor

Brian Brown rbb at techgame.net
Thu Aug 12 19:50:57 CEST 2004


On Aug 12, 2004, at 10:46 AM, LK wrote:

> First,  Thanks for the help on previous threads.  I now have a GOODS 
> db accessed at the session level. I have a  PMLogEditor class that 
> allows me to modify GOODS log entries.
> I want to have a 'Cancel' button that will return to the calling 
> method, without saving any changes to the current record.  I saved the 
> current values in #oldItem.  But it seems that they get changed when 
> the #item values change.  Below is my code for this part of the 
> application.
>
> PMLogsView>>modify: thisRecord
>    self call: (PMLogEditor new item: thisRecord).
>
> --------------
> PMLogEditor>>renderContentOn: html
>    "show Edit a Log form"
>
>    oldItem _ item    " save current values of item before editing"

I think you need to do:

oldItem _ item copy

so that you actually get a new object, and not just a reference to the 
current one. That is why it always changes, you are just pointing to 
the original.

Brian





More information about the Seaside mailing list