Re: Getting the selected list values..
Re: Getting the selected list values..
- Subject: Re: Getting the selected list values..
- From: David LeBer <email@hidden>
- Date: Sat, 27 Mar 2004 21:10:35 -0500
On 27-Mar-04, at 8:26 PM, James Cicenia wrote:
Hello -
In my quest to solve my many-to-many problem...
On my form I have a repeating list with two columns that is
dynamically generated.
Column a is name and column b has a popup of which I am trying to get
the selection.
What do I do to loop through the list to get the selected values upon
submittal?
Instead of binding the selection binding of the popup to an ivar, bind
it to a setter and getter method that do what you need to do.
For instance if the popup is going to allow you to reassign a
relationship: The getter should return the current relationship, the
setter should delete the existing one and create the new one.
So if you have a repetition of Users, with the popup showing companies.
User <<----> Company
Popup bindings:
list NSArray containing all companies
item userItem
selection selectedCompany
public Company selectedCompany() {
return userItem.company();
}
public void setSelectedCompany(Company value) {
if (userItem.company() != null) {
userItem.removeObjectFromBothSidesOfRelationshipWithKey(userItem.company
(), "company");
}
userItem.addObjectToBothSidesOfRelationshipWithKey(value, "company");
}
Hope that helps,
;david
--
David LeBer
Codebase Software Systems
site: http://www.codebase.ca
blog: http://david.codebase.ca
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.