• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Getting the selected list values..
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting the selected list values..


  • Subject: Re: Getting the selected list values..
  • From: David LeBer <email@hidden>
  • Date: Sat, 27 Mar 2004 21:22:58 -0500

On 27-Mar-04, at 9: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");
}

Y'know...

I just realized that this example is stupid...

You'd just bind userItem.company to the selection binding of the popup and be done with it.

But the methodology is useful elsewhere I guess.

;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.


References: 
 >Getting the selected list values.. (From: James Cicenia <email@hidden>)
 >Re: Getting the selected list values.. (From: David LeBer <email@hidden>)

  • Prev by Date: Re: Getting the selected list values..
  • Next by Date: Re: Getting the selected list values..
  • Previous by thread: Re: Getting the selected list values..
  • Next by thread: Re: Getting the selected list values..
  • Index(es):
    • Date
    • Thread