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
Hi Larry
It should say "allRecords remove: aRecord" and not #removeAt: (latter takes an integer to remove an item from the ordered collection at a specific index).
Adrian
On Jul 24, 2004, at 4:22 AM, LK wrote:
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
Seaside mailing list Seaside@lists.squeakfoundation.org http://lists.squeakfoundation.org/listinfo/seaside
___________________ Adrian Lienhard www.adrian-lienhard.ch www.netstyle.ch
Adrian Lienhard wrote:
Hi Larry
It should say "allRecords remove: aRecord" and not #removeAt: (latter takes an integer to remove an item from the ordered collection at a specific index).
Adrian
Thanks, That executed w/o error, but. nothing was removed from GOODS. I added this method: delete: aRecord from: aDatabase (self confirm: 'Are you sure you want to delete: ', (aRecord entryText) printString, '?') ifTrue: [allRecords remove: aRecord. aDatabase commit.].
It says that it cannot understand #commit. In workspace, db commit executes properly. What am I missing here?????
-Larry
On Jul 24, 2004, at 4:22 AM, LK wrote:
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 from db] 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:
----- SNIP -----
On Jul 24, 2004, at 7:35 AM, LK wrote:
Adrian Lienhard wrote:
Hi Larry
It should say "allRecords remove: aRecord" and not #removeAt: (latter takes an integer to remove an item from the ordered collection at a specific index).
Adrian
Thanks, That executed w/o error, but. nothing was removed from GOODS. I added this method: delete: aRecord from: aDatabase (self confirm: 'Are you sure you want to delete: ', (aRecord entryText) printString, '?') ifTrue: [allRecords remove: aRecord. aDatabase commit.].
It says that it cannot understand #commit. In workspace, db commit executes properly. What am I missing here?????
Well, you must somehow have the wrong object passed in as aDatabase. When the MNU #commit error comes up, what class does it say aDatabase is? That might give you a clue as to what's going wrong.
Avi
Avi Bryant wrote:
On Jul 24, 2004, at 7:35 AM, LK wrote:
Adrian Lienhard wrote:
Hi Larry
It should say "allRecords remove: aRecord" and not #removeAt: (latter takes an integer to remove an item from the ordered collection at a specific index).
Adrian
Thanks, That executed w/o error, but. nothing was removed from GOODS. I added this method: delete: aRecord from: aDatabase (self confirm: 'Are you sure you want to delete: ', (aRecord entryText) printString, '?') ifTrue: [allRecords remove: aRecord. aDatabase commit.].
It says that it cannot understand #commit. In workspace, db commit executes properly. What am I missing here?????
Well, you must somehow have the wrong object passed in as aDatabase. When the MNU #commit error comes up, what class does it say aDatabase is? That might give you a clue as to what's going wrong.
Avi
It says aDatabase is nil. So, it's not getting passed to the PMLogsView method properly. Moving the db connect method to the PMLogsView class solves the problem. But, it would be nice if the database connection was opened in the object that calls PMLogsView, and passed to the subcomponents.
PMLogsTask>>RenderLoop db := dbConnection new.. PMLogsView ( which would include calls to PMLogsAddItem, PMLogsModifyItem, PMLogsDeleteITem, etc which would need access to the db connection in order to do #commit and #refresh) . . . db logout. ----------------- How would I make the db object available to nested subcomponents?
-Larry
On Jul 27, 2004, at 8:58 PM, LK wrote:
It says aDatabase is nil. So, it's not getting passed to the PMLogsView method properly. Moving the db connect method to the PMLogsView class solves the problem. But, it would be nice if the database connection was opened in the object that calls PMLogsView, and passed to the subcomponents.
PMLogsTask>>RenderLoop db := dbConnection new.. PMLogsView ( which would include calls to PMLogsAddItem, PMLogsModifyItem, PMLogsDeleteITem, etc which would need access to the db connection in order to do #commit and #refresh) . . . db logout.
How would I make the db object available to nested subcomponents?
The usual way is to access it through the session, which is available to any component through #session, or anything else through "WACurrentSession value". Just subclass WASession to include a db instance variable, and configure your app to use that session class. Brian Brown has some documentation of this pattern here:
http://www.techgame.net/projects/Seaside/wiki/SetupSessionForGOODS
Avi
seaside@lists.squeakfoundation.org