Discussion:
Binding query variables (EOF Fetch Spec Qualifier) under IB
Ryu
2005-02-21 16:28:52 UTC
Permalink
Hi there,

I want to write a front end to a DB, that has a search form, WITHOUT writing
code. I already successfully wrote a front end that can browse all elements,
and add/remove/modify an entry with writing code.

To avoid loading all the table that has 2 millions entries (hence not "in
memory" filtering with EOPickTextAssociation), I have to make a specific SQL
query.

Under EOBuilder, I have added a Fetch Spec to my table Entity
In this Fetch Spec, I have added the Qualifier "(name = $myName)"

But once under Interface Builder, I just can't find how to bind user
interface (NSField, NSForm) to my Query Variable (nyName).
There is no @queryBindings->myName (or @bindings->myName) in the inspector
(Inspector/Connections/EOTextAssociation) when binding to the EODisplayGroup
that has my FetchSpec (like they talk about in the docs)

Though, I have @query= (which seems to be the WOBuilder's @queryMatch). I
was able to make a "simple search form", by binding my NSField to
@QueryMatch->name. But the request which is made is case insensitive, and
not exact match, and I want to be able to execute complex sql request as
made in EOBuilder Fetch Spec.

Does anyone know where are the "Query Variables"/@queryBidings in the
Interface Builder, how to bind them to interface elements, so that I can
execute a request without writing code ?

Regards,
Ryu
Ricardo Strausz
2005-02-28 17:13:00 UTC
Permalink
Hola Ryu!
can you be more specific... which platform are you using?
You mentioned Interface Builder; are you trying Java Client? or
Cocoa/EOF?

Dino
Post by Ryu
Hi there,
I want to write a front end to a DB, that has a search form, WITHOUT writing
code. I already successfully wrote a front end that can browse all elements,
and add/remove/modify an entry with writing code.
To avoid loading all the table that has 2 millions entries (hence not "in
memory" filtering with EOPickTextAssociation), I have to make a specific SQL
query.
Under EOBuilder, I have added a Fetch Spec to my table Entity
In this Fetch Spec, I have added the Qualifier "(name = $myName)"
But once under Interface Builder, I just can't find how to bind user
interface (NSField, NSForm) to my Query Variable (nyName).
(Inspector/Connections/EOTextAssociation) when binding to the
EODisplayGroup
that has my FetchSpec (like they talk about in the docs)
@queryMatch). I
was able to make a "simple search form", by binding my NSField to
@QueryMatch->name. But the request which is made is case insensitive, and
not exact match, and I want to be able to execute complex sql request as
made in EOBuilder Fetch Spec.
Interface Builder, how to bind them to interface elements, so that I can
execute a request without writing code ?
Regards,
Ryu
_______________________________________________
EOF mailing list
http://www.omnigroup.com/mailman/listinfo/eof
Ricardo Strausz
2005-02-28 17:11:13 UTC
Permalink
Hola Ryu!
can you be more specific... which platform are you using?
You mentioned Interface Builder; are you trying Java Client? or
Cocoa/EOF?

Dino
Post by Ryu
Hi there,
I want to write a front end to a DB, that has a search form, WITHOUT writing
code. I already successfully wrote a front end that can browse all elements,
and add/remove/modify an entry with writing code.
To avoid loading all the table that has 2 millions entries (hence not "in
memory" filtering with EOPickTextAssociation), I have to make a specific SQL
query.
Under EOBuilder, I have added a Fetch Spec to my table Entity
In this Fetch Spec, I have added the Qualifier "(name = $myName)"
But once under Interface Builder, I just can't find how to bind user
interface (NSField, NSForm) to my Query Variable (nyName).
(Inspector/Connections/EOTextAssociation) when binding to the
EODisplayGroup
that has my FetchSpec (like they talk about in the docs)
@queryMatch). I
was able to make a "simple search form", by binding my NSField to
@QueryMatch->name. But the request which is made is case insensitive, and
not exact match, and I want to be able to execute complex sql request as
made in EOBuilder Fetch Spec.
Interface Builder, how to bind them to interface elements, so that I can
execute a request without writing code ?
Regards,
Ryu
_______________________________________________
EOF mailing list
http://www.omnigroup.com/mailman/listinfo/eof
Ryu
2005-03-01 09:14:40 UTC
Permalink
I'm using OSX, and up to now Cocoa/EOF, but it's ok me for me
to use Java and make a Java Client Application. (Anyway, up to
Now I don't have a line of code, so I think it doesn't change anything
if using ObjC or Java)

Hence, I use EOBuilder to build my database, and Interface builder
To build my interface.

It is quite frustrating because I'm sure we can do the bindings graphically
under IB, exactly like it is shown under WebObjectBuilder (there are even
Screenshots in the docs! And they say it's the same under IB).
Post by Ricardo Strausz
Post by Ryu
code. I already successfully wrote a front end that can browse all
elements,
and add/remove/modify an entry with writing code.
I wanted to say that I could do this WITHOUT writing anycode, and that
I expected to do so for such a simple think as binding Query Variables
Of my Qualifier to interface elements (NSTextFied)



New point:

As I couldn't find "how to" bind my query variables to my interface
Objects (TextFields...) using InterfaceBuilder, I tried to make it
Programmatically using Objc, but it seems there are some pbs :-(

my fetch spec looks like

(name = $name)

And the code:

fetch = [[displayGroup dataSource] fetchSpecification];
qual = [fetch qualifier];
bindings = [NSMutableDictionary new];
[bindings takeStoredValue: @"Baka" forKey: @"name"];

And

q2 = [qual qualifierWithBindings: bindings : NO];

Makes:

2005-02-25 11:52:26.206 Baka[808]
com/webobjects/foundation/NSKeyValueCoding$UnknownKeyException:
<com.apple.cocoa.foundation.NSMutableDictionary 0xbf47df> valueForKey():
lookup of unknown key: 'name'.
This class does not have an instance variable of the name name or _name, nor
a method of the name name, _name, getName, or _getName

The same way,

fetch = [fetch fetchSpecificationWithQualifierBindings: bindings];

Or

[[displayGroup dataSource] setQualifierBindings: bindings];

Make exactly the same error!

I was said the was a Javabridge problem, but I just don't know ...
I think I'm gonna try to make excatly the same code in Java using
a Java Client Application to compare ...


Any help is greatly appreciated!!!

Regards,

Ryu
Post by Ricardo Strausz
Hola Ryu!
can you be more specific... which platform are you using?
You mentioned Interface Builder; are you trying Java Client? or
Cocoa/EOF?
Dino
Post by Ryu
Hi there,
I want to write a front end to a DB, that has a search form, WITHOUT
writing
code. I already successfully wrote a front end that can browse all
elements,
and add/remove/modify an entry with writing code.
To avoid loading all the table that has 2 millions entries (hence not
"in
memory" filtering with EOPickTextAssociation), I have to make a
specific SQL
query.
Under EOBuilder, I have added a Fetch Spec to my table Entity
In this Fetch Spec, I have added the Qualifier "(name = $myName)"
But once under Interface Builder, I just can't find how to bind user
interface (NSField, NSForm) to my Query Variable (nyName).
inspector
(Inspector/Connections/EOTextAssociation) when binding to the
EODisplayGroup
that has my FetchSpec (like they talk about in the docs)
@queryMatch). I
was able to make a "simple search form", by binding my NSField to
@QueryMatch->name. But the request which is made is case insensitive,
and
not exact match, and I want to be able to execute complex sql request
as
made in EOBuilder Fetch Spec.
Interface Builder, how to bind them to interface elements, so that I
can
execute a request without writing code ?
Regards,
Ryu
_______________________________________________
EOF mailing list
http://www.omnigroup.com/mailman/listinfo/eof
Ryan Poling
2005-03-01 16:11:53 UTC
Permalink
Hi,

Maybe I'm missing what your problem is, but I've been successful
binding interface items to use for queries in Interface Builder. I'm
building a Java Client App, but I think it would be the same for you.

Here's what I do:

- Control drag and connect from text field to EODisplayGroup in IB main
window.
-
Ricardo Strausz
2005-03-02 03:05:25 UTC
Permalink
Hola!

Since you are using Cocoa/eof the best you can do is forget about WO...
that is, you are dealing with a client/server app.
Secondly; you most remember that, behind the scenes, you are using the
so-called Java-Bridge; therefore, you most know how does it translates
objects from one side to the other. In particular you most be aware
that those objects which come from com.webobjects.* do not translate
naturally into those which are "related" to com.apple.*. In particular,
what you seems to need is to distinguish from the
com.webobjects.foundation.NSDictionary and the
com.apple.foundation.NSDictionary: they are *different* kind of
objects.

Take a look to
http://wodev.spearway.com/cgi-bin/WebObjects/WODev.woa/wa/Main?
wikiPage=CocoaEOApplication

to read about some hints on the subject... and let me know if you need
more help.

HIH
Dino
Post by Ryu
I'm using OSX, and up to now Cocoa/EOF, but it's ok me for me
to use Java and make a Java Client Application. (Anyway, up to
Now I don't have a line of code, so I think it doesn't change anything
if using ObjC or Java)
Hence, I use EOBuilder to build my database, and Interface builder
To build my interface.
It is quite frustrating because I'm sure we can do the bindings graphically
under IB, exactly like it is shown under WebObjectBuilder (there are even
Screenshots in the docs! And they say it's the same under IB).
Post by Ricardo Strausz
Post by Ryu
code. I already successfully wrote a front end that can browse all
elements,
and add/remove/modify an entry with writing code.
I wanted to say that I could do this WITHOUT writing anycode, and that
I expected to do so for such a simple think as binding Query Variables
Of my Qualifier to interface elements (NSTextFied)
As I couldn't find "how to" bind my query variables to my interface
Objects (TextFields...) using InterfaceBuilder, I tried to make it
Programmatically using Objc, but it seems there are some pbs :-(
my fetch spec looks like
(name = $name)
fetch = [[displayGroup dataSource] fetchSpecification];
qual = [fetch qualifier];
bindings = [NSMutableDictionary new];
And
q2 = [qual qualifierWithBindings: bindings : NO];
2005-02-25 11:52:26.206 Baka[808]
<com.apple.cocoa.foundation.NSMutableDictionary 0xbf47df>
lookup of unknown key: 'name'.
This class does not have an instance variable of the name name or _name, nor
a method of the name name, _name, getName, or _getName
The same way,
fetch = [fetch fetchSpecificationWithQualifierBindings: bindings];
Or
[[displayGroup dataSource] setQualifierBindings: bindings];
Make exactly the same error!
I was said the was a Javabridge problem, but I just don't know ...
I think I'm gonna try to make excatly the same code in Java using
a Java Client Application to compare ...
Any help is greatly appreciated!!!
Regards,
Ryu
Post by Ricardo Strausz
Hola Ryu!
can you be more specific... which platform are you using?
You mentioned Interface Builder; are you trying Java Client? or
Cocoa/EOF?
Dino
Post by Ryu
Hi there,
I want to write a front end to a DB, that has a search form, WITHOUT
writing
code. I already successfully wrote a front end that can browse all
elements,
and add/remove/modify an entry with writing code.
To avoid loading all the table that has 2 millions entries (hence not
"in
memory" filtering with EOPickTextAssociation), I have to make a
specific SQL
query.
Under EOBuilder, I have added a Fetch Spec to my table Entity
In this Fetch Spec, I have added the Qualifier "(name = $myName)"
But once under Interface Builder, I just can't find how to bind user
interface (NSField, NSForm) to my Query Variable (nyName).
inspector
(Inspector/Connections/EOTextAssociation) when binding to the
EODisplayGroup
that has my FetchSpec (like they talk about in the docs)
@queryMatch). I
was able to make a "simple search form", by binding my NSField to
@QueryMatch->name. But the request which is made is case insensitive,
and
not exact match, and I want to be able to execute complex sql request
as
made in EOBuilder Fetch Spec.
Interface Builder, how to bind them to interface elements, so that I
can
execute a request without writing code ?
Regards,
Ryu
_______________________________________________
EOF mailing list
http://www.omnigroup.com/mailman/listinfo/eof
Ricardo Strausz
2005-03-04 17:15:30 UTC
Permalink
I forgot to say...
you may replace the third line of code below for

bindings =
[NSClassFromString(@"com.webobjects.foundation.NSMutableDictionary)
new];

this will give you the correct instance/class.
Dino
Post by Ryu
fetch = [[displayGroup dataSource] fetchSpecification];
qual = [fetch qualifier];
bindings = [NSMutableDictionary new];
And
q2 = [qual qualifierWithBindings: bindings : NO];
2005-02-25 11:52:26.206 Baka[808]
<com.apple.cocoa.foundation.NSMutableDictionary 0xbf47df>
lookup of unknown key: 'name'.
This class does not have an instance variable of the name name or _name, nor
a method of the name name, _name, getName, or _getName
Ryu
2005-03-01 09:23:35 UTC
Permalink
I'm using OSX, and up to now Cocoa/EOF, but it's ok me for me
to use Java and make a Java Client Application. (Anyway, up to
Now I don't have a line of code, so I think it doesn't change anything
if using ObjC or Java)

Hence, I use EOBuilder to build my database, and Interface builder
To build my interface.

It is quite frustrating because I'm sure we can do the bindings graphically
under IB, exactly like it is shown under WebObjectBuilder (there are even
Screenshots in the docs! And they say it's the same under IB).
Post by Ricardo Strausz
Post by Ryu
code. I already successfully wrote a front end that can browse all
elements,
and add/remove/modify an entry with writing code.
I wanted to say that I could do this WITHOUT writing anycode, and that
I expected to do so for such a simple think as binding Query Variables
Of my Qualifier to interface elements (NSTextFied)



New point:

As I couldn't find "how to" bind my query variables to my interface
Objects (TextFields...) using InterfaceBuilder, I tried to make it
Programmatically using Objc, but it seems there are some pbs :-(

my fetch spec looks like

(name = $name)

And the code:

fetch = [[displayGroup dataSource] fetchSpecification];
qual = [fetch qualifier];
bindings = [NSMutableDictionary new];
[bindings takeStoredValue: @"Baka" forKey: @"name"];

And

q2 = [qual qualifierWithBindings: bindings : NO];

Makes:

2005-02-25 11:52:26.206 Baka[808]
com/webobjects/foundation/NSKeyValueCoding$UnknownKeyException:
<com.apple.cocoa.foundation.NSMutableDictionary 0xbf47df> valueForKey():
lookup of unknown key: 'name'.
This class does not have an instance variable of the name name or _name, nor
a method of the name name, _name, getName, or _getName

The same way,

fetch = [fetch fetchSpecificationWithQualifierBindings: bindings];

Or

[[displayGroup dataSource] setQualifierBindings: bindings];

Make exactly the same error!

I was said the was a Javabridge problem, but I just don't know ...
I think I'm gonna try to make excatly the same code in Java using
a Java Client Application to compare ...


Any help is greatly appreciated!!!

Regards,

Ryu
Post by Ricardo Strausz
Hola Ryu!
can you be more specific... which platform are you using?
You mentioned Interface Builder; are you trying Java Client? or
Cocoa/EOF?
Dino
Post by Ryu
Hi there,
I want to write a front end to a DB, that has a search form, WITHOUT
writing
code. I already successfully wrote a front end that can browse all
elements,
and add/remove/modify an entry with writing code.
To avoid loading all the table that has 2 millions entries (hence not
"in
memory" filtering with EOPickTextAssociation), I have to make a
specific SQL
query.
Under EOBuilder, I have added a Fetch Spec to my table Entity
In this Fetch Spec, I have added the Qualifier "(name = $myName)"
But once under Interface Builder, I just can't find how to bind user
interface (NSField, NSForm) to my Query Variable (nyName).
inspector
(Inspector/Connections/EOTextAssociation) when binding to the
EODisplayGroup
that has my FetchSpec (like they talk about in the docs)
@queryMatch). I
was able to make a "simple search form", by binding my NSField to
@QueryMatch->name. But the request which is made is case insensitive,
and
not exact match, and I want to be able to execute complex sql request
as
made in EOBuilder Fetch Spec.
Interface Builder, how to bind them to interface elements, so that I
can
execute a request without writing code ?
Regards,
Ryu
_______________________________________________
EOF mailing list
http://www.omnigroup.com/mailman/listinfo/eof
Ryan Poling
2005-03-01 16:48:32 UTC
Permalink
Hi,

Okay, I think I understand your problem now. Unfortunately, our
program doesn't use any fetch specifications defined in the EOModel, so
I don't know how to help you with that. In the cases where I've needed
to alter a fetch specification from the default one which IB produces,
I've done it in the code - not in the model.

In fact, I think I've just used the EODisplayGroup.Delegate method
called 'displayGroupDisplayArrayForObjects' to alter which items are
displayed.

I'd be curious to hear if you figure it out though.

Good luck.

-Ryan
I'll try to be more explicit.
What I've succesfully done is stuff about EOTextAssociation/value for
I can't use the Fetch Specification I've created on my table (under
EOBuilder) In that FetchSpec, I've created a Qualifier
(name = $aName)
So I have to bind some NSTextField to the Qualifier Variable $aName
@query>.
But there isn't!!!
Though, in the screen shots of WOBuilderin the docs, I can see the
@querybingins->queryVars and @queryMatch (which should be the IB's
@query=)
in the same inspector!
So I think I've missed something ...
I hope I was more clear so may be you can help me more!
Regards,
Ryu
Post by Ryan Poling
Hi,
Maybe I'm missing what your problem is, but I've been successful
binding interface items to use for queries in Interface Builder. I'm
building a Java Client App, but I think it would be the same for you.
- Control drag and connect from text field to EODisplayGroup in IB
main
window.
-
Loading...