[Seaside] Trouble with undo on Record Editor

LK s002 at landr.net
Thu Aug 12 18:46:34 CEST 2004


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"
    html
        form: [html
                table: [html
          . . . .
                
            html submitButtonWithAction: [self undoChanges. self answer] 
text: 'Cancel'.
            html space: 5.
            html submitButtonWithAction: [self clear] text: 'Clear'].
--------------------
PMLogEditor>>undoChanges
    " Restore original values to item"
    item _ oldItem.

-Thanks for the help.
-Larry



More information about the Seaside mailing list