• 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: Adding Objects to an ArrayList (Checkboxes)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding Objects to an ArrayList (Checkboxes)


  • Subject: Re: Adding Objects to an ArrayList (Checkboxes)
  • From: LD <email@hidden>
  • Date: Tue, 11 Oct 2005 16:13:20 +1000

Hi again,

On 11/10/2005, at 2:44 PM, LD wrote:

For the gem, to get the current list of selected servers (about 2-3 lines of readable code) see updateServerSelectionsAndProcessEmail() action below. It's simple; easy.

Woops...

<...>
    public WOComponent updateServerSelectionsAndProcessEmail() {
        EmailServerContacts nextPage;
        NSArray allServers;
        NSDictionary allServerSelections;

updateServerSelections();
nextPage = ( EmailServerContacts )pageWithName ( "EmailServerContacts" );
nextPage.setEc( ec() );


//
// ==== the ease of KeyValueCoding ====
// ==== assume that aServer.isSelected() returns a Boolean object ====
//
allServers = allServers();

allServerSelections = new NSDictionary ( allServers.valueForKey( "isSelected" ), allServers );


nextPage.setServers( allServerSelections.allKeysForObject ( Boolean.TRUE ) );

        return nextPage;
    }
}
<...>

with regards,
--

LD


_______________________________________________ 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
  • Follow-Ups:
    • Re: Adding Objects to an ArrayList (Checkboxes)
      • From: Janice Cheung <email@hidden>
References: 
 >Adding Objects to an ArrayList (Checkboxes) (From: Janice Cheung <email@hidden>)
 >Re: Adding Objects to an ArrayList (Checkboxes) (From: LD <email@hidden>)

  • Prev by Date: New license?
  • Next by Date: Re: New license?
  • Previous by thread: Re: Adding Objects to an ArrayList (Checkboxes)
  • Next by thread: Re: Adding Objects to an ArrayList (Checkboxes)
  • Index(es):
    • Date
    • Thread