Re: Binding query variables (EOF Fetch Spec Qualifier) under IB

Ricardo Strausz <[email protected]> Tue, 1 Mar 2005 21:05:25 -0600
Newsgroups gmane.comp.web.webobjects.eof
Message-ID <[email protected]>
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



On Mar 1, 2005, at 3:14, Ryu wrote:

>
> 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).
>
> PS: in my last mail, I said:
>
>>> 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
>
>
> On 28/02/05 18:13, "Ricardo Strausz" <[email protected]> wrote:
>
>> 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
>>
>> On Feb 21, 2005, at 10:28 AM, Ryu wrote:
>>
>>>
>>>
>>>
>>> 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
>>>
>>>
>>> _______________________________________________
>>> EOF mailing list
>>> [email protected]
>>> http://www.omnigroup.com/mailman/listinfo/eof
>>
>
>