[Seaside] Changes in GOODS not showing in browser
LK
s002 at landr.net
Fri Jul 30 16:01:37 CEST 2004
Thanks for all the support. You guys are the greatest!
I now have an app that will add and delete records from a GOODS
database. My problem now is they added records are not showing in the
PMLogsView when I refresh my browser. The user must close and re-open
the browser to see the changes. Is there a way to fix this?
-Larry
Relevent code is below:
PMLogsTask>>renderContentOn: html
|db |
html cssId: 'banner'.
html table: [
html tableRowWith: [
html divNamed: 'title' with: self title.
html divNamed: 'subtitle' with: self subtitle.
]
].
html render: pmLogsView.
html text: 'testing'.
-----
PMLogsView>>renderContentOn: html
| |
html table: [
html tableRow: [html tableHeading: 'View all Log Entries';
space; space; space.]].
html anchorWithAction: [self call: PMLogAddItem new] text: 'Add'.
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: []
]
-----------
PMLogAddItem>>renderContentOn: html
" show add new log form"
item := PMLogItem new.
item initialize.
html form: [
html table: [
html tableRow: [html tableHeading: 'New Log Entry'].
html tableRow: [html tableData: 'Date'. html tableData: item
entryDate].
html tableRow: [html tableData: 'Time'. html tableData: item
startTime].
html tableRow: [html tableData: 'Type'. html tableData:
[html selectFromList: #('DRE' 'SA' 'DBA' 'TEST') selected: (item type)
callback: [:i | item type: i]]].
html tableRow: [html tableData: 'Entry Text'. html
tableData: [ html textAreaWithValue: 'log entry' callback: [:i| item
entryText: i]]].
].
html submitButtonWithAction: [self add: item] text: 'Save'.
]
---------
PMLogAddItem>>add: aRecord
db _ PMDatabase new connect.
self table: (db root at: 'logs').
table add: aRecord.
db commit.
db flush.
db logout.
self answer.
-----
More information about the Seaside
mailing list