I finally solved that by changing name and proxyName so I could use in my javascript: window[this.proxyName].autocomplete.getSuggestions(value);

I create variable for every autocompleted field and then use personalized proxy.

On 7/10/12 11:01 PM, Jean-François Veillette wrote:
I'm trying to implement autocomplete based on my database and I want to use 
AjaxProxy for that. I have two different fields on the same page that need to 
be auto completed. I create two AjaxProxy objects:

FirstAutocompleteProxy : PMAjaxProxy {
name = "autocomplete";
proxy = firstProxy;
proxyName = "firstName";
}

SecondAutocompleteProxy : PMAjaxProxy {
name = "autocomplete";
proxy = secondProxy;
proxyName = "secondName";
}

and I want to use in my javascript code sth like this:
autocomplete[this.proxyName].getSuggestions(value);

where firstProxy and secondProxy implements interface that has method 
getSuggestions(String).

Unfortunately only first object is created and only it works. Can I use the 
same name for both objects and manipulate only with proxyName? If not, how can 
I use multiple proxies on one page?
Look at the generated html code, you should have 2 vars ( var firstName, 
secondName).
On the java side they should reference the same 'autocomplete' jsonBridge 
object which should have 2 references, for firstProxy and secondProxy.
There might be a bug with sharing the same bridge (I wrote the first draft of 
that component and do not remember testing this feature much ... maybe it got 
never used and tested and so there could be a bug in it).  You would have to 
debug it and give us more information.

--
jfv




--
Damian Stasiak

Power Media S.A.
ul. Grabiszyńska 241B
53-235 Wrocław
http://www.power.com.pl

Sąd Rejonowy dla Wrocławia Fabrycznej
KRS 0000281947
NIP: 898-16-47-572
Kapitał Zakładowy: 640.000 PLN

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to