• 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: WOCheckBox Howto?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: WOCheckBox Howto?


  • Subject: Re: WOCheckBox Howto?
  • From: Mark Morris <email@hidden>
  • Date: Sat, 25 Feb 2006 01:39:19 -0600

Hello Jim,

You can use the "isChecked" binding to do this.

For example, bind it to a method named "companyIsInArray". Assume your WORepetition's "item" binding is set to "currentCompany", and the destination (mutable) array is called "companyArray". Then write something like (warning, not debugged!):

	public boolean companyIsInArray() {
	   return companyArray.containsObject( currentCompany );
	}

	public void setCompanyIsInArray( boolean value ) {
	   if( value && !companyIsInArray() ) {
	      companyArray.addObject( currentCompany );
	   }
	   if( !value && companyIsInArray() ) {
	      companyArray.removeObject( currentCompany );
	   }
	}

This would do what you want.

Regards,
Mark

On Feb 24, 2006, at 11:34 PM, Jim Wong wrote:


I want to display a list of objects from entity COMPANY. the list will be displayed using WORepetition. Each line will contain the companyName and a WOCheckBox. When "GO" button is clicked, I want to pass all the selections into a NSMutableArray. But I dunno how to code this. ANyone can help? Thanks.


Jim
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40onpointsoftware.com


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >WOCheckBox Howto? (From: Jim Wong <email@hidden>)

  • Prev by Date: WOCheckBox Howto?
  • Next by Date: XMLHttpRequests using WebObjects
  • Previous by thread: WOCheckBox Howto?
  • Next by thread: Sophisticated relationship help
  • Index(es):
    • Date
    • Thread