com.webobjects.foundation.NSValidation$ValidationException: The country property of Addresses is not allowed to be null.
Reason:The country property of Addresses is not allowed to be null.
The UI displays the popups and values correctly. I set the the value in the UI, but when I submit, I get the above error.
Do I have to manually get the set value and stick it in the table before I submit? Here are some details:
I instantiate an Object "newPerson" of class "Person".
Person has a one-to-many called addresses to an Entity name Addresses.
I instantiate an Object "anAddress" of class "Address"
Address has several one-to-one relationships, in the above error, it is referring to the "country" relationship.
I drag a WOOneTo Element to the WOBuilder. I set the sourceRelationshipKey to "country", the sourceEntity to "Addresses", and the sourceObject to anAdress.
When I click submit, registerPerson() is called. Here is that function:
public WOComponent registerPerson()
{
EOEditingContext ec = session().defaultEditingContext();
ec.insertObject(anAddress);
ec.insertObject(aPhoneNumber1);
ec.insertObject(aPhoneNumber2);
ec.insertObject(anEmailAddr1);
ec.insertObject(anEmailAddr2);
newPerson.addObjectToBothSidesOfRelationshipWithKey(anAddress, "addressess");
newPerson.addObjectToBothSidesOfRelationshipWithKey(aPhoneNumber1, "phoneNumberss");
newPerson.addObjectToBothSidesOfRelationshipWithKey(aPhoneNumber2, "phoneNumberss");
newPerson.addObjectToBothSidesOfRelationshipWithKey(anEmailAddr1, "emailAddrss");
newPerson.addObjectToBothSidesOfRelationshipWithKey(anEmailAddr2, "emailAddrss");
ec.insertObject(newPerson);
ec.saveChanges();
return null;
}