I have a similar problem with popoups and loosing the connection to the selection. I am wondering if you can shed some light on the problem...
basically, I have two popups (Category and SubCategory). If the user changes the Category, the action method then goes off to the backend to get the list for the subcategory.
this is a copy of what I sent to the
email@hidden mail list.:
any chance this looks similar....?
++++++++
I am still having a bear of a time with some popups. I have objects ContactCategory and SubCategory
one ContactCategory many SubCategory(s)
My ContactCategory.java has setters and getters for an array of subcategories
public NSArray<SubCategory> theSubCategories() {
return _theSubCategories;
}
public void setTheSubCategory(NSArray<SubCategory> theSubCatArray) {
this._theSubCategories = (NSMutableArray<SubCategory>) theSubCatArray;
}
I read the Categories with:
contactCategoryList = ContactCategory.fetchAllContactCategories(contactEC);
then:
for (int i=0; i<contactCategoryList.count(); i++) {
EOQualifier qual = SubCategory.CONTACT_CATEGORY.eq(contactCategoryList.objectAtIndex(i));
NSArray<SubCategory> subCatArray = (NSArray<SubCategory>)SubCategory.fetchSubCategories(contactEC, qual, null);
contactCategoryList.objectAtIndex(i).setTheSubCategory(subCatArray);
}
My popup buttons are bound like this:
CategoryPopUpEE : WOPopUpButton {
list = contactCategoryList;
id = "categoryEEPopUpID";
displayString = categoryObjectForPopUp.categoryTitle;
item = categoryObjectForPopUp;
selection = current.contactCategory;
}
CategoryPopUpEEObserveField : AjaxObserveField {
updateContainerID = "SubCatEEDiv";
observeFieldID = "categoryEEPopUpID";
fullSubmit = false;
}
SubCategoryEEUpdateContainer : AjaxUpdateContainer {
id = "SubCatEEDiv";
}
SubCategoryPopUpEEField : WOPopUpButton {
list = current.contactCategory.theSubCategories;
id = "subCatEEID";
displayString = subCatObject.subCatTitle;
item = subCatObject;
selection = current.subCategory;
}
My problem:
When I view a record, I can change the CategoryPopUpEE and saveChanges or I can view a record and change the SubCat however, if I change the CategoryPopUpEE and the subCategoryPopUp list changes I can select a new subCat but the selection is not updating the selection binding.
I even tried to add an observeField that was watching the SubCategoryPopUpEEField with an action. If I view a record, then change the subCategory I get joy. However if I change the Category the observed action method does not fire when I change the SubCategoryPopUpEEField.
Help please.
What else can I send to help me through this dilemma?
Ted