[Seaside] Deleting from GOODS.

LK s002 at landr.net
Sat Jul 24 16:35:48 CEST 2004


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 -----




More information about the Seaside mailing list