• 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: Display Groups
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Display Groups


  • Subject: Re: Display Groups
  • From: Nathan Dumar <email@hidden>
  • Date: Fri, 23 Jul 2004 12:47:49 -0400

On Jul 22, 2004, at 10:06 PM, Sam Barnum wrote:

One big gripe: insertObject() does NOT return the object being inserted! It returns null. Get the inserted object by callinng selectedObject().

Do you mean the method insert()?

When reading the API, it sounded to me like it would overwrite an existing object if I did not first clear the selection. I also didn't see anything about the inserted object automatically being selected. So here's what I did:

userDisplayGroup.clearSelection(); // clears selection so index is at end of display group
userDisplayGroup.insert(); // inserts the new object at the end, because selection is cleared
Integer i = (Integer)userDisplayGroup.indexOfLastDisplayedObject() - 1; // get number of new object
userDisplayGroup.setSelectionIndexes(new NSArray(i); // set selection to i - the new object


This is according to my understanding of the display group. I may have done more work than was necessary.

Yet, it's a fine illustration of what Lotsa means when he says,

2. Sometimes (mostly?) they are very difficult to get to behave the way one wants.

Sometimes it's more trouble to manipulate them than it is to just write stuff yourself.


Thanks to Art's help (and patience), I've come to appreciate them for what they are: a specialized tool that can be a great help in a very specific circumstance. Otherwise, it's easier to skip them and do it yourself.

Nathan
_______________________________________________
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.


  • Follow-Ups:
    • Re: Display Groups
      • From: Sam Barnum <email@hidden>
    • Re: Display Groups
      • From: Nathan Dumar <email@hidden>
References: 
 >Display Groups (From: Lotsa Cabo <email@hidden>)
 >Re: Display Groups (From: Arturo PĂ©rez <email@hidden>)

  • Prev by Date: WODisplayGroup display list repetition
  • Next by Date: Best way to perform an action from a string variable
  • Previous by thread: Re: Display Groups
  • Next by thread: Re: Display Groups
  • Index(es):
    • Date
    • Thread