Re: Getting the selected list values..
Re: Getting the selected list values..
- Subject: Re: Getting the selected list values..
- From: James Cicenia <email@hidden>
- Date: Sat, 27 Mar 2004 20:34:10 -0600
David -
I started down that path.. but now my confusion lies with the fact that
mine is a many-to-many relationship.
This means that my scheme would be more like...
User << ----- > Company << ----- >> Accountants
where say the accountant gets one user to service for each company.
Than he would see a list of companies in column A and a popup of users
in
column B for him to select.
Has my head spinning.
-James Cicenia
On Mar 27, 2004, at 8:10 PM, David LeBer wrote:
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.compan
y(), "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.
_______________________________________________
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.