WODisplayGroup - how to insert default values?
WODisplayGroup - how to insert default values?
- Subject: WODisplayGroup - how to insert default values?
- From: Clive Roberts <email@hidden>
- Date: Thu, 21 Apr 2005 10:03:39 +0100
I do not normally use WODisplayGroups and want to use one to list and insert EOObjects (CharityMembers). It should be simple, but I am having difficulty setting default values!
My EOEnterpriseObject - CharityMember - has a "type" (an inheritance attribute for single table inheritance) that needs to be be programmatically set to a non-null value.
I created a Display Group Component using XCode and chose a layout to display a selected record, paginated, and then selected the attributes to display and for a hyperlink. The wizard creates the component complete with:
protected CharityMember charitymember; // used when an object is selected
protected WODisplayGroup charitymemberDisplayGroup;
public MemberList(WOContext context) { ...
public void selectObject() {...
public void saveChanges() throws Exception {...
The component calls "
charitymemberDisplayGroup.insert();" to insert new values into the display group. and calls saveChanges() to persist objects.
The component WOTextFields have settings "charitymemberDisplayGroup.selectedObject..."
QUESTION: how should I set the value of the "type"?
I have tried e.g. ... .takeStoredValueForKey("CM", "type"); on the display group's selectedObject(), but when I save I get an exception saying the value for type must not be null!
What am I missing?
thanks in anticipation
Clive Roberts
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden