Hello hallowed halls...
NT 4, SP3, SQL6.5, WOF4/EOF3.0
This one's actually a two parter... kinda. The initial issue was addressed in the release notes, #2174345, and I've used the workaround of adding reciprocal relationships for my to-many relationships. However, that wasn't enough to solve the initial issue, i.e...
I have a to-many from Individual to PhoneNumber. A WODispGrp uses a WORepetition to display the Individual(s) when the page is loaded using a fetch-spec from the .woo archive. The main page has a link to a "number editing" page. When this link is chosen, I execute the following code...
// from Main.java
public PhoneNumbers showPhones() {
PhoneNumbers nextPage = (PhoneNumbers)pageWithName("PhoneNumbers");
// Initialize your component here
Individual selection = (Individual)individualDisplayGroup.selectedObject();
nextPage.setSelectedIndividual(selection);
return nextPage;
}
// end Main.java <snip-snip>
// from PhoneNumbers.java
public void setSelectedIndividual(Individual newSelectedIndividual) {
selectedIndividual = newSelectedIndividual;
phoneNumberDisplayGroup.setObjectArray(selectedIndividual.phoneNumber());
}
// end PhoneNumbers.java <snip-snip>
The PhoneNumber display group is then used by a WOPopUpButton in conjunction w/ some text fields to display the chosen phone number. Also, the display group has the generic Insert/Update/Delete buttons associated w/ it, though I've mapped Insert to the following action...
// from PhoneNumbers.java
public WOComponent insertPhone() {
phoneNumberDisplayGroup.insert();
PhoneNumber newPhone = (PhoneNumber)phoneNumberDisplayGroup.selectedObject();
selectedIndividual.addObjectToBothSidesOfRelationshipWithKey(newPhone, "phoneNumber");
System.out.println("Individual phone : " + selectedIndividual.phoneNumber());
return null;
}
And here's where I run into problems. The insert and save work as far as the PhoneNumber entity is concerned. That is, new phone numbers can be created and added to the database. However, oidIndividual, the to-many target of Individual.phoneNumber, is always set to NULL in the database. My guess here is that the oid on Individual is not being propogated to the PhoneNumbers page, when I set PhoneNumbers.selectedIndvidual = individualDisplayGroup.selectedObject(). Does this have to do w/ the fact that oid, though it is the primary key, isn't defined as a class property of Individual and therefore isn't stored w/in the entity itself? Or is the issue compeletely different?
All thoughts eagerly anticipated.
thanks
mx.
Michael G Xenakis PLATINUM technology, inc
[EMAIL PROTECTED] 800.365.7528 x43007
"Anyone who isn't confused here doesn't really understand what's going on!"
- Re: WOF4: saveChanges won't create relationships. Michael Xenakis
- Re: WOF4: saveChanges won't create relationships. Michael Xenakis
