[Seaside] Deleting from GOODS.
Avi Bryant
avi at beta4.com
Wed Jul 28 06:44:33 CEST 2004
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
More information about the Seaside
mailing list