[Seaside] Deleting from GOODS.

LK s002 at landr.net
Sat Jul 24 04:22:18 CEST 2004


OK, I've got a table that will display records from my GOODS database. 
Many thanks to Bany and Shaffer.  Would someone tell me what's wrong 
with my delete:  method.?   I've taken code from a 'table tutorial' and 
modified it as follows:

my PMLogsView class has an allRecords instance var which holds the 
PMLogs ( Ordered Collection ol PMLogItem objects).

PMLogsView>>renderContentOn: html
   | |
   allRecords := db root at: 'logs'.
   html table: [
       html tableRow: [html tableHeading: 'View all Log Entries']].
   html attributeAt: 'cellspacing' put: 0; attributeAt: 'cellpadding' 
put: 5; attributeAt: 'border' put: 2.
   html table: [
           allRecords do: [:i |
               html tableRow: [
                   html tableData: [html anchorWithAction: [self delete: 
i] text: 'Del'].
                   html tableData: i type.
                   html tableData: i entryDate.
                   html tableData: i startTime.
                   html tableData: i entryText.
                   html tableData: i endTime.
           ].
       ].
       html tableRow: []
]
-----------------------------
The delete: method looks like this:

PMLogsView>>delete: aRecord
(self confirm: 'Are you sure you want to delete ', (aRecord entryText) 
printString, '?')
ifTrue: [allRecords removeAt: aRecord]
----------------------------
When I excute it Seaside displays the following error:


 MessageNotUnderstood: PMLogItem>><

   * PMLogItem(Object)>>doesNotUnderstand: #<

         self     a PMLogItem
         aMessage     a Message with selector: #< and arguments: #(1)

   * KKObjectProxy>>doesNotUnderstand: #<

         self     a PMLogItem
         aMessage     a Message with selector: #< and arguments: #(1)

   * PMLogs(OrderedCollection)>>at:

         self     a PMLogs(a PMLogItem a PMLogItem a PMLogItem a PMLogItem)
         anInteger     a PMLogItem

   * PMLogs(OrderedCollection)>>removeAt:

         self     a PMLogs(a PMLogItem a PMLogItem a PMLogItem a PMLogItem)
         index     a PMLogItem
         removed     nil

   * KKObjectProxy>>doesNotUnderstand: #removeAt:

         self     a PMLogs(a PMLogItem a PMLogItem a PMLogItem a PMLogItem)
         aMessage     a Message with selector: #removeAt: and arguments:
         #(a PMLogItem)

   * PMLogsView>>delete:

         self     a PMLogsView
         aRecord     a PMLogItem

   * [] in PMLogsView>>renderContentOn:

         self     a PMLogsView
         html     a WAHtmlRenderer
         i     a PMLogItem

   * WAActionCallback>>evaluateWithArgument:

         self     a WAActionCallback
         anObject     ''

   * WAActionCallback(WACallback)>>evaluateWithField:

         self     a WAActionCallback
         anObject     ''

   * WACallbackStream>>processCallbacksWithOwner:

         self     a WACallbackStream
         anObject     a PMLogsView
         callback     a WAActionCallback

   * PMLogsView(WAPresenter)>>processCallbackStream:

         self     a PMLogsView
         aCallbackStream     a WACallbackStream

   * [] in PMLogsTask(WAPresenter)>>processChildCallbacks:

         self     a PMLogsTask
         aStream     a WACallbackStream
         ea     a PMLogsView

   * PMLogsView(WAComponent)>>decorationChainDo:

         self     a PMLogsView
         aBlock     [] in PMLogsTask(WAPresenter)>>processChildCallbacks:

   * [] in PMLogsTask(WAComponent)>>nextPresentersDo:

         self     a PMLogsTask
         aBlock     [] in PMLogsTask(WAPresenter)>>processChildCallbacks:
         ea     a PMLogsView

   * [] in PMLogsTask(WAComponent)>>childrenDo:

         self     a PMLogsTask
         aBlock     [] in PMLogsTask(WAComponent)>>nextPresentersDo:
         ea     a PMLogsView

   * Array(SequenceableCollection)>>do:

         self     #(a PMLogsView)
         aBlock     [] in PMLogsTask(WAComponent)>>childrenDo:
         index     1
         indexLimiT     1

   * PMLogsTask(WAComponent)>>childrenDo:

         self     a PMLogsTask
         aBlock     [] in PMLogsTask(WAComponent)>>nextPresentersDo:
         ea     a PMLogsView

   * PMLogsTask(WAComponent)>>nextPresentersDo:

         self     a PMLogsTask
         aBlock     [] in PMLogsTask(WAPresenter)>>processChildCallbacks:
         ea     a PMLogsView

   * PMLogsTask(WAPresenter)>>processChildCallbacks:

         self     a PMLogsTask
         aStream     a WACallbackStream
         ea     a PMLogsView

   * PMLogsTask(WAPresenter)>>processCallbackStream:

         self     a PMLogsTask
         aCallbackStream     a WACallbackStream

   * [] in WAToolFrame(WAPresenter)>>processChildCallbacks:

         self     a WAToolFrame
         aStream     a WACallbackStream
         ea     a PMLogsTask

   * PMLogsTask(WAComponent)>>decorationChainDo:

         self     a PMLogsTask
         aBlock     [] in WAToolFrame(WAPresenter)>>processChildCallbacks:

   * [] in WAToolFrame(WAComponent)>>nextPresentersDo:

         self     a WAToolFrame
         aBlock     [] in WAToolFrame(WAPresenter)>>processChildCallbacks:
         ea     a PMLogsTask

   * [] in WAToolFrame(WAComponent)>>childrenDo:

         self     a WAToolFrame
         aBlock     [] in WAToolFrame(WAComponent)>>nextPresentersDo:
         ea     a PMLogsTask

   * Array(SequenceableCollection)>>do:

         self     #(a PMLogsTask)
         aBlock     [] in WAToolFrame(WAComponent)>>childrenDo:
         index     1
         indexLimiT     1

   * WAToolFrame(WAComponent)>>childrenDo:

         self     a WAToolFrame
         aBlock     [] in WAToolFrame(WAComponent)>>nextPresentersDo:
         ea     a PMLogsTask

   * WAToolFrame(WAComponent)>>nextPresentersDo:

         self     a WAToolFrame
         aBlock     [] in WAToolFrame(WAPresenter)>>processChildCallbacks:
         ea     a PMLogsTask

   * WAToolFrame(WAPresenter)>>processChildCallbacks:

         self     a WAToolFrame
         aStream     a WACallbackStream
         ea     a PMLogsTask

   * WAToolFrame(WAPresenter)>>processCallbackStream:

         self     a WAToolFrame
         aCallbackStream     a WACallbackStream

   * [] in WARenderLoop>>processCallbacks:

         self     a WARenderLoop
         aCallbackStream     a WACallbackStream
         lastPosition     0
         ea     a WAToolFrame

   * WAToolFrame(WAComponent)>>decorationChainDo:

         self     a WAToolFrame
         aBlock     [] in WARenderLoop>>processCallbacks:

   * WARenderLoop>>processCallbacks:

         self     a WARenderLoop
         aCallbackStream     a WACallbackStream
         lastPosition     0
         ea     a WAToolFrame

   * WARenderLoop>>render

         self     a WARenderLoop
         request     a WARequest
         context     a WARenderingContext
         document     nil
         docRoot     nil
         url     nil
         response     nil
         ea     nil

   * [] in WARenderLoop>>run

         self     a WARenderLoop
         notification     nil

   * BlockContext>>on:do:

         self     [] in WARenderLoop>>run
         exception     WARenderNotification
         handlerAction     [] in WARenderLoop>>withRenderNowHandler:
         handlerActive     true

   * WARenderLoop>>withRenderNowHandler:

         self     a WARenderLoop
         aBlock     [] in WARenderLoop>>run
         n     nil

   * [] in WARenderLoop>>run

         self     a WARenderLoop
         notification     nil

   * BlockContext>>on:do:

         self     [] in WARenderLoop>>run
         exception     WAPageExpired
         handlerAction     [] in WARenderLoop>>withPageExpiredHandler:
         handlerActive     true

   * WARenderLoop>>withPageExpiredHandler:

         self     a WARenderLoop
         aBlock     [] in WARenderLoop>>run
         n     nil

   * [] in WARenderLoop>>run

         self     a WARenderLoop
         notification     nil

   * BlockContext>>repeat

         self     [] in WARenderLoop>>run

   * WARenderLoop>>run

         self     a WARenderLoop
         notification     nil

   * WARenderLoopMain>>start:

         self     a WARenderLoopMain
         aRequest     a WARequest

   * WASession>>start:

         self     a WASession(/seaside/logs?_s=YGJFCkUdbwMVquFZ)
         aRequest     a WARequest

   * [] in WASession>>performRequest:

         self     a WASession(/seaside/logs?_s=YGJFCkUdbwMVquFZ)
         aRequest     a WARequest
         key     nil
         continuation     nil

   * Dictionary>>at:ifAbsent:

         self     a Dictionary()
         key     '_k'
         aBlock     [] in WASession>>performRequest:
         assoc     nil

   * WASession>>performRequest:

         self     a WASession(/seaside/logs?_s=YGJFCkUdbwMVquFZ)
         aRequest     a WARequest
         key     nil
         continuation     nil

   * [] in WASession>>responseForRequest:

         self     a WASession(/seaside/logs?_s=YGJFCkUdbwMVquFZ)
         aRequest     a WARequest

   * BlockContext>>on:do:

         self     [] in WASession>>responseForRequest:
         exception     Error
         handlerAction     [] in WASession>>withErrorHandler:
         handlerActive     false

   * [] in WASession>>withErrorHandler:

         self     a WASession(/seaside/logs?_s=YGJFCkUdbwMVquFZ)
         aBlock     [] in WASession>>responseForRequest:
         e     MessageNotUnderstood: PMLogItem>><
         w     nil

   * BlockContext>>on:do:

         self     [] in WASession>>withErrorHandler:
         exception     Warning
         handlerAction     [] in WASession>>withErrorHandler:
         handlerActive     true

   * WASession>>withErrorHandler:

         self     a WASession(/seaside/logs?_s=YGJFCkUdbwMVquFZ)
         aBlock     [] in WASession>>responseForRequest:
         e     MessageNotUnderstood: PMLogItem>><
         w     nil

   * [] in WASession>>responseForRequest:

         self     a WASession(/seaside/logs?_s=YGJFCkUdbwMVquFZ)
         aRequest     a WARequest

   * BlockContext>>on:do:

         self     [] in WASession>>responseForRequest:
         exception     WACurrentSession
         handlerAction     [] in WACurrentSession class(WADynamicVariable
         class)>>use:during:
         handlerActive     true

   * WACurrentSession class(WADynamicVariable class)>>use:during:

         self     WACurrentSession
         anObject     a WASession(/seaside/logs?_s=YGJFCkUdbwMVquFZ)
         aBlock     [] in WASession>>responseForRequest:
         n     WACurrentSession

   * [] in WASession>>responseForRequest:

         self     a WASession(/seaside/logs?_s=YGJFCkUdbwMVquFZ)
         aRequest     a WARequest

   * [] in WASession>>withEscapeContinuation:

         self     a WASession(/seaside/logs?_s=YGJFCkUdbwMVquFZ)
         aBlock     [] in WASession>>responseForRequest:
         cc     a Continuation

   * Continuation class>>currentDo:

         self     Continuation
         aBlock     [] in WASession>>withEscapeContinuation:

   * WASession>>withEscapeContinuation:

         self     a WASession(/seaside/logs?_s=YGJFCkUdbwMVquFZ)
         aBlock     [] in WASession>>responseForRequest:
         cc     a Continuation

   * WASession>>responseForRequest:

         self     a WASession(/seaside/logs?_s=YGJFCkUdbwMVquFZ)
         aRequest     a WARequest

   * [] in WASession>>incomingRequest:

         self     a WASession(/seaside/logs?_s=YGJFCkUdbwMVquFZ)
         aRequest     a WARequest
         e     nil

   * BlockContext>>on:do:

         self     [] in WASession>>incomingRequest:
         exception     Error
         handlerAction     [] in WASession>>incomingRequest:
         handlerActive     true

   * [] in WAProcessMonitor>>critical:ifError:

         self     a WAProcessMonitor
         aBlock     [] in WASession>>incomingRequest:
         errorBlock     [] in WASession>>incomingRequest:
         value     a WAResponse

   * BlockContext>>ensure:

         self     [] in WAProcessMonitor>>critical:ifError:
         aBlock     [] in WAProcessMonitor>>critical:ifError:
         returnValue     nil

   * [] in WAProcessMonitor>>critical:ifError:

         self     a WAProcessMonitor
         aBlock     [] in WASession>>incomingRequest:
         errorBlock     [] in WASession>>incomingRequest:
         value     a WAResponse

   * [] in BlockContext>>newProcess

         self     [] in WAProcessMonitor>>critical:ifError:


Thanks for the help.
-Larry




More information about the Seaside mailing list