Re: EODisplayGroup
Re: EODisplayGroup
- Subject: Re: EODisplayGroup
- From: Yves Custeau <email@hidden>
- Date: Fri, 18 Jun 2004 08:56:37 -0400
Thanks Nathan
Before posting my mail to the group I read the EODisplayGroup documentation
on Apple web site. I'm using that documentation extensively these days :-)
I just could not figure out how to use the API to make a specific record the
current (or selected) record to use functions like:
selectedObjectValueForKey().
I was successful this morning using the following method
anEOdg.setSelectionIndexes(new NSArray(selectionNumber));
That method is useful if you have an index.
But if you have a value that is within the data? I still cannot understand
how I could use the following function to search:
anEOdg.selectObject(personObj);
Where do you get that "personObj" from to perform the selection ? What type
of object is it?
For example if the user types the Product_Number in a textfield, how can I
use this function to search for the object that has Product_Number == 10
and make that Object the current (or selected) object??
Thanks for your help !!!
> From: Nathan Dumar <email@hidden>
> Date: Thu, 17 Jun 2004 18:26:17 -0400
> To: WebObjects Developer <email@hidden>
> Subject: Re: EODisplayGroup
>
> The doc page for the EODisplayGroup will help ...
>
> http://developer.apple.com/documentation/WebObjects/Reference/API/com/
> webobjects/eointerface/EODisplayGroup.html
>
> Starting with the method selectObject(), you'll find a short list of
> methods to select a single or a group of objects. The summary is, you
> pass an object to the EODG using one of the methods and it will look
> for a match; if it finds a match, it will select it. You can then
> access that object using the selectedObject() method.
>
> // set selection
> anEOdg.selectObject(personObj);
> // or, for what you describe ... selectionNumber is an Integer with
> // a value of 9(I *think* the numbering starts at zero ...)
> anEOdg.setSelectionIndexes(new NSArray(selectionNumber));
>
> // use selection
> anEOdg.selectedObject().name();
>
> WODisplayGroups are similar, and have different functionality that may
> be useful to you, not to mention they're very easy to set up (but have
> other limits that make them impractical in some situations). The
> EODisplayGroup and the WODisplayGroup have many similar methods.
>
> http://developer.apple.com/documentation/WebObjects/Reference/API/com/
> webobjects/appserver/WODisplayGroup.html
>
>
> Nathan
>
>
> On Jun 17, 2004, at 3:22 PM, Yves Custeau wrote:
>
>> Hello,
>>
>> I need to programmatically select a specific entry of an
>> EODisplayGroup. I'm
>> having difficulty doing so.
>>
>> I can traverse the result set with a FOR loop and get the associated
>> value
>> using:
>> eodisplaygroup.valueForObjectAtIndex(i,"valuetoretrieve").toString()
>>
>> Let say I want to make the 10th entry the SELECTED object what
>> function do
>> you use for that?
>>
>> I guess that there is a better way than looping 10 times over the
>> selectNext() function
>>
>> Thanks !!
> _______________________________________________
> 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.