I'm learning to use Seaside with Omnibase and am having some issues.
I'm getting a "ODBError: Object is not persistent or is a part of
composite persistent object" when calling markDirty on an object.
Here is the setup for the app.
I'm using a custom Session class, BLGSession, which is a subclass of
ODBSSession.
I have one domain object, BLGPost, and two components. One for
listing posts, BLGPostList, and another for creating and editing them,
BLGPostEdit.
BLGPost inherits from ODBSPersistentObject. It has a body attribute
with the following setter:
BLGPost>>body: anObject
body := anObject.
self markDirty.
The edit component is causing the problem. When I call it to modify
the body attribute of a Post I get the "not persistent" message.
BLGPostEdit>>post
^ post isNil
ifTrue: [post := BLGPost new]
ifFalse: [post]
BLGPostEdit>>renderContentOn: html
html form:
[html paragraph:
[html label for: 'post_title'; with: 'Title'.
html break.
html textInput on: #title of: self post].
html paragraph:
[html label for: 'post_body'; with: 'Body'.
html break.
html textArea on: #body of: self post].
html submitButton callback: [self answer: self post]].
I've tried many variations and permutations of this, but can't seem to
get this to work. Anything obvious that I'm missing? Is my approach
off?
Thanks,
Wilkes