I have Contacts that have Category and SubCategory(s).
I have two dependent popups (Category and SubCategory) for each contact..
CategoryPopup is being observed and has an action that populates the
SubCategoryPopUp. SubCategoryPopUp's selection is bound to
so far so good. the subcatpopup's selection is bound to current.subCategory.
If I edit a Contact, and change the subcat, submit the form and saveChanges()
everything is okay. However if I change category (then the subcategory popup is
repopulated) and change the subcategory at the same time, the subcategory
doesn't get saved.
here are the popupbutton's HTML section:
<tr><td>Category</td><td><webobject name = "CategoryPopUpEE"/><webobject name =
"CategoryPopUpEEObserveField"/></td></tr>
<tr><td>SubCategory</td><td><webobject name =
"SubCategoryEEUpdateContainer"><webobject name =
"SubCategoryPopUpEE"/></webobject><webobject name =
"SubCategoryPopUpEEObserveField"/></td>
and the WOD
CategoryPopUpEE : WOPopUpButton {
list = cCListForPopup;
id = "categoryEEPopUpID";
displayString = categoryObjectForPopUp.categoryTitle;
item = categoryObjectForPopUp;
selection = current.contactCategory;
}
CategoryPopUpEEObserveField : AjaxObserveField {
observeFieldID = "categoryEEPopUpID";
updateContainerID = "SubCatEEDiv";
action = getSubCatsForCategoryEE;
fullSubmit = false;
}
SubCategoryEEUpdateContainer : AjaxUpdateContainer {
id = "SubCatEEDiv";
}
SubCategoryPopUpEE : WOPopUpButton {
list = subCategoryList;
id = "SubCategoryPopUpEEID";
displayString = subCatObject.subCatTitle;
item = subCatObject;
selection = current.subCategory;
}
SubCategoryPopUpEEObserveField : AjaxObserveField {
observeFieldID = "SubCategoryPopUpEEID";
//updateContainerID = "editTableBody";
//action = updateSubCat;
fullSubmit = false;
}
here is the action from CategoryPopUpEEObserveField:
public void getSubCatsForCategoryEE() {
EOQualifier qual =
SubCategory.CONTACT_CATEGORY.eq(current.contactCategory());
subCategoryList = SubCategory.fetchSubCategories(contactEC, qual, null);
current.setSubCategory(subCategoryList.objectAtIndex(0));
}
I am at such a loss. I know the answer is staring me in the face.
Ted
_______________________________________________
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]