[Seaside] Deleting from GOODS.
LK
s002 at landr.net
Wed Jul 28 05:58:37 CEST 2004
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
More information about the Seaside
mailing list