use this
------------------------------------------------------- NSMutableDictionary bindings = new NSMutableDictionary();
bindings.setObjectForKey(variable value,fetch variable);
EOEditingContext ec = new
EOEditingContext(); -------------------------------------------------------
public NSArray fetchArray(String fetch, String
entity, NSMutableDictionary bindings, EOEditingContext ec)
{
EOFetchSpecification fs = EOFetchSpecification.fetchSpecificationNamed(fetch,
entity);
if (bindings !=
null)
{
fs = fs.fetchSpecificationWithQualifierBindings(bindings);
}
NSArray objects = ec.objectsWithFetchSpecification(fs);
if (objects.count() > 0)
{
return objects;
}
else
{
return null;
}
}
-------------------------------------------------------
or this
public
EOGenericRecord fetchRow(String fetch, String entity, NSMutableDictionary
bindings, EOEditingContext ec)
{
EOFetchSpecification fs =
EOFetchSpecification.fetchSpecificationNamed(fetch,
entity);
fs =
fs.fetchSpecificationWithQualifierBindings(bindings);
NSArray objects =
ec.objectsWithFetchSpecification(fs);
// return
(EOGenericRecord) objects.objectAtIndex(0);
if (objects.count()
> 0)
{
return
(EOGenericRecord) objects.objectAtIndex(0);
}
else
{
return null;
}
}
-------------------------------------------------------
----- Original Message ----- From:
"Ryu" <email@hidden> To:
<email@hidden> Sent: Thursday, February 17, 2005 1:15
PM Subject: Binding EOF Fecth Qualifier in IB
Hi
there,
I'm an old NeXT developer, getting back into OSX. My
question may sound easy, but I couldn't find "how to" on the web, so here I
post.
I'm writing a Obj-C/Cocoa application that uses EOF (No lines of
code up to now so Obj-C doesn't matter)
Here is what I want to do: a
search form in a database (containing millions of entries, so I can't select
all, then search in memeory) using Appkit/Interface Builder. The database was
designed using EOF/EOModeler. I have added a Fetch Specification to may
table, with a Qualifier:
name = $name
Once
under IB, I just can't find how to link some NSTextField or NSForm to the
Qualifier Variable.
Though, Apple doc
says
http://developer.apple.com/documentation/WebObjects/UsingEOModeler/8WorkingW ithFetchSpecifications/chapter_8_section_2.html
"
You do this by dragging a fetch specification into either WebObjects Builder
or Interface Builder and then binding user interface elements to keys in the
display group that correspond to the fetch specification¹s variables
"
"In Interface Builder, the steps are similar except that you bind the
user interface elements to @bindings.title, @bindings.date,
and @bindings.studioName keys of your display group. The @bindings
syntax represents the value associated with the named qualifier
variable"
I got a new EODisplayGroup object configured with my Fecth
Spec, but I can't find anything related to @bindings or (@querybindings) in
the inspector of my NSFormCell
inspector (connections/EOTextAssociation/EOPickTextAssociation), nor in the
inspector of my EODisplayGroup.
Last thing: I understand how to make
it programmatically, but I want to do it under IB
I think it should
be as easy as a 2 click operation (like browsing all entries and adding new
entries in DB), but couldn't find how to! Plz
help!
Regards,
Ryu
_______________________________________________ Do
not post admin requests to the list. They will be ignored. Webobjects-dev
mailing list
(email@hidden) Help/Unsubscribe/Update your
email sent to email@hidden
|