On Nov 22, 2005, at 7:57 AM, Jeremy Matthews wrote:
Seems simple, doesn't it?
'tis! ;-)
I've reconstructed the fetch and syntax in EOM and reflected
changes in code and in WOB; now the fetch values populate the array
(popup) correctly, and shows values in the popup correctly.
Now, a new entry gets inserted correctly (all text fields),
excepting the value chosen from the popup list. It gets set to null.
So, I need to figure out why the selected popup value is not set
correctly, even if a value is chosen. It always goes to null.
Since I'm populating the popup from a fetch, do I need to write a
takeValueForKey statement?
No.
WOD:
displayString: testTypeEnumerator.testType
item: testTypeEnumerator
list: testList
noSelectionString: "Choose one!"
selection: newTestsEntry.testType
Looks OK.
Code:
public WOComponent addTest()
{
EOEditingContext ec = session().defaultEditingContext();
ec.insertObject(v);
SHRIEK!!!!!!!!
Nooooooooooooooooooo.
Um, don't do it like that. :-)
Best practice:
TestsEntry newTestsEntry = EOUtilities.createAndInsertInstance(ec,
"TestsEntry");
You are messing with an EO that is not in an EC. Apple tutorials
nonwithstanding, this is a Bad Idea.
Though the null problem may lie elsewhere.
Chuck
System.out.println("Saving new Test" + newTestsEntry);
ec.saveChanges();
newTestsEntry = new Tests();
return context().page();
}
Thanks,
jeremy
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/chill%
40global-village.net
This email sent to [EMAIL PROTECTED]
--
Coming in 2006 - an introduction to web applications using WebObjects
and Xcode http://www.global-village.net/wointro
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems. http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]