• 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: Fetch Spec Misunderstanding
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fetch Spec Misunderstanding


  • Subject: Re: Fetch Spec Misunderstanding
  • From: "Jerry W. Walker" <email@hidden>
  • Date: Wed, 27 Jul 2005 00:45:27 -0400

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
  • Follow-Ups:
    • Re: Fetch Spec Misunderstanding
      • From: Darich Runyan/OMNI INFOSEC LTD HQ <email@hidden>
References: 
 >Re: Fetch Spec Misunderstanding (From: Darich Runyan/OMNI INFOSEC LTD HQ <email@hidden>)

  • Prev by Date: Re: Fetch Spec Misunderstanding
  • Next by Date: Sort order in WODisplayGroup
  • Previous by thread: Re: Fetch Spec Misunderstanding
  • Next by thread: Re: Fetch Spec Misunderstanding
  • Index(es):
    • Date
    • Thread