Re: Fetch Spec Misunderstanding
Re: Fetch Spec Misunderstanding
- Subject: Re: Fetch Spec Misunderstanding
- From: Darich Runyan/OMNI INFOSEC LTD HQ <email@hidden>
- Date: Wed, 27 Jul 2005 09:20:59 -0400
Thanks for the ideas. I fooled around with this some and was never able to
get it to work. Maybe I am going about this the wrong way. Is there a
better way to obtain just a single column from the database that is just the
values and not the key/value pair?
Thanks,
Darich
> From: "Jerry W. Walker" <email@hidden>
> Date: Wed, 27 Jul 2005 00:45:27 -0400
> To: Darich Runyan/OMNI INFOSEC LTD HQ <email@hidden>
> Cc: WebObjects Development <email@hidden>
> Subject: Re: Fetch Spec Misunderstanding
>
> Hi, Darich,
>
> Raw fetches return NSArrays of NSDictionaries, of which, an
> EOMutableKnownKeyDictionary is probably a subclass (I'm not really
> familiar with it, per se).
>
> So long as it's an NSDictionary, you should simply be able to bind
> your pop-up button to the key name of the key-value pair you
> retrieved and it should display only the value based on that key. The
> fact that each of your dictionaries in the array contains only one
> key-value pair, notwithstanding.
>
> So, presume that myFetchSpec exists and that you've fetched an array
> named myObjects as follows:
>
> NSDictionary aRow; // Iteration variable
> NSDictionary selectedRow; // used to hold selected element from
> WOPopUpButton
> myFetchSpec.setRawRowKeyPaths(new NSArray
> ( "myAttribute" ); // sets the keypath for fetching raw rows with
> only one key-value pair
> NSArray myObjects =
> myEditingContext.objectsWithFetchSpecification(myFetchSpec); //
> Fetches raw rows as specified above
>
> Now, set up your WOPopUpButton with the following bindings:
>
> list = myObjects;
> item = aRow;
> displayString = aRow.myAttribute
> selection = selectedRow
>
> Replace "myAttribute", of course, with the name of the attribute that
> you want displayed. The WOPopUpButton should display what you want.
>
> The above was done from memory, so may contain errors.
>
> Regards,
> Jerry
>
> On Jul 27, 2005, at 12:14 AM, Darich Runyan/OMNI INFOSEC LTD HQ wrote:
>
>> I found out a bit more. Looks like the Raw Fetch is returning a
>> EOMutableKnownKeyDictionary which is not quite what I want. Seems
>> that I
>> need to be using a formatter. Is there any good docs on how to set
>> one of
>> these up?
>>
>> Thanks,
>> Darich
>>
>>
>>> From: Darich Runyan/OMNI INFOSEC LTD HQ <email@hidden>
>>> Date: Tue, 26 Jul 2005 23:41:05 -0400
>>> To: WebObjects Development <email@hidden>
>>> Subject: Fetch Spec Misunderstanding
>>>
>>> All,
>>>
>>> This solution to the problem I am having should be easy yet I am
>>> unable to
>>> find an answer. Up until this evening my application has only
>>> allowed users
>>> to input data and return complete sets via WORepetitions. This works
>>> nicely. I now have a request to provide just portions of a
>>> certain tables,
>>> specifically a single column from each that will then be used to
>>> populate a
>>> WOPopUpButton. To do this I have created a Raw Fetch
>>> Specification in the
>>> EOModel that returns just the column that I want from the entity.
>>> This
>>> almost works fine except it returns the values in the following
>>> format:
>>>
>>> {columnName = "value";}
>>>
>>> So my PopUpButton gets populated with a bit of extraneous
>>> information. Do I
>>> have to parse this prior to creating the WOPopUpButton in order to
>>> only have
>>> the values added to it or is there some way to have the fetch spec
>>> just
>>> return the value sans the column name?
>>>
>>> Thanks,
>>> Darich
>>>
>>>
>>> _______________________________________________
>>> Do not post admin requests to the list. They will be ignored.
>>> Webobjects-dev mailing list (email@hidden)
>>> Help/Unsubscribe/Update your Subscription:
>>>
>>>
>> infosec.co>
>> m
>>
>>>
>>> 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:
>> 40codefab.com
>>
>> This email sent to email@hidden
>>
>
>
> --
> __ Jerry W. Walker, Partner
> C o d e F a b, LLC - "High Performance Industrial Strength
> Internet Enabled Systems"
> email@hidden
> 212 465 8484 X-102 office
> 212 465 9178 fax
>
>
_______________________________________________
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