Will have to play with this in the morning,
but...
isn't element a string?
What i wanted to try was
document.getElementById(element).tacosAutocompleter = this;
i believe i've done it before :)

But still, tacos should hold on to those autocompleter instances
so that you don't have to hack... or at least others don't have to
- i bet you're enjoying it. 

Anyway, i had another idea  yesterday while thinking about 
this (not 100% related)... what if we could have another binding, 
that would return the runtime (in-browser) value of an html control... 
This would allow cool stuff, such as
<a jwcid="@DirectLink" parameters="valueOf:inputName">Click</a>
but i'm not optimistic it's doable.
Perhaps a custom Link renderer is a better solution for this kind of 
problems.


>From Pedro Viegas <[EMAIL PROTECTED]>:

> Hi there Andy,
> 
> Been playing around with what you proposed but not much success.
> I'm not doing exactly the same thing you proposed.
> I left out the initialization of the Tacos AutoCompleter alone and instead I
> have overwritten the Initialize method of it in a sort of a hack to the
> component.
> Something like...
> 
> hackAjaxAutocompleter = function() {
>     Ajax.Autocompleter.prototype.initialize = function(element, update, url,
> options) {
>         var parameterExpression=/(sp=[^&]*&)/;
> 
>         dojo.debug("Initialize started...");
>         this.baseInitialize(element, update, options);
>         this.options.asynchronous  = true;
>         this.options.onComplete    = this.onComplete.bind(this);
>         this.options.defaultParams = this.options.parameters || null;
>         this.url = url.replace(parameterExpression,"$1sp=S" +
> this.options.IDValue + "&");
> 
>         element.tacosAutocompleter = this;
> 
>         dojo.debug("this=" + this);
>         dojo.debug("element=" + element);
>         dojo.debug("element.id=" + element.id);
>         dojo.debug("element.tacosAutocompleter=" +
> element.tacosAutocompleter);
>         dojo.debug("Initialize ended.");
>     }
> }
> 
> So this way I would get a clean hack to the component.
> (of course I still had to do a override of the Trigger method in the Java
> class, but that's not important, that works fine, and my code is called
> since the listener is correcly called with both parameters (the change I
> introduced in the hack).
> 
> So I'm trying your solution here, but adapted to my code.
> I didn't know I could simply assume there is a new property to a DOM object
> (like the "XXX.tacosAutocompleter" here), but I can't get it to work.
> The debug for my case here is...
> 
> DEBUG: Initialize started...
> DEBUG: url=http://localhost/delegateIt/app?component=jobSea...
> DEBUG: this=[object Object]
> DEBUG: element=innerjobSearch
> DEBUG: element.id=undefined
> DEBUG: element.tacosAutocompleter=undefined
> DEBUG: Initialize ended: url=
> http://localhost/delegateIt/app?component=jobSea...
> 
> So, the element is a valid DOM, "this" is instantiated, of course, but the
> tacosAutocompleter attribution is ignored, since after it evaluates to null!
> Either I didn't understand what you meant or I'm doing something wrong.
> 
> Help! :-)
> 
> 
> 
> On 5/29/06, Andreas Andreou <[EMAIL PROTECTED]> wrote:
> >
> > Hmmm... you have a point here...
> >
> > in tacos.js we create script.aculo.us autocompleters using:
> > new Ajax.Autocompleter(inpId, updId, updUrl, updParams);
> > and
> > new Autocompleter.Local(inpId, updId, values, updParams);
> > and so, we don't store anywhere those references...
> >
> > And looking at their source, it's not possible to get such a reference
> > from the 'enhanced' html element.
> >
> > So, you would like to store those references somewhere, so that users
> > can get them and use them somehow, correct?
> >
> > something like dojo does with dojo.widget.manager and dojo.widget.byId
> > perhaps...
> > I don't know if it's safe to put them there.
> >
> > Another solution would be to simply do:
> > var instance = new Ajax.Autocompleter(inpId, updId, updUrl, updParams);
> > document.getElementById(inpId).tacosAutocompleter = instance;
> >
> > What do you think?
> >
> >
> >
> > Pedro Viegas wrote:
> > > Thanks Andy.
> > >
> > > I had thought of that workarround, but being the TacosAutocompleter
> > > based on a script.acul.uous Ajax.AutoCompleter widget how can I change
> > > the URL parameter of the widget?
> > > If it were a dojo widget I would now how to get it, but like this
> > > after creating the widget how can I in a JS event get a reference to
> > > it so I can change it?
> > > Maybe I'm being a little newbie in this but honnestly I'm in a bit of
> > > a stall!
> > > Anybody who nows a bit more about this script.acul.uous
> > > Ajax.AutoCompleter widget can help me? Andy, how about that, can you
> > > give me a opinter on this specific issue.
> > >
> > > Reagrds,
> > >
> > >
> > > On 5/26/06, [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>*
> > > <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:
> > >
> > >     the AutoCompleter in svn trunk supports a 'parameters'
> > >     parameter - just like the one found in DirectLink
> > >     see
> > >
> >
>
http://svn.sourceforge.net/viewcvs.cgi/tacos/trunk/src/java/net/sf/tacos/ajax/components/Autocompleter.jwc?view=markup
> > >     <
> >
>
http://svn.sourceforge.net/viewcvs.cgi/tacos/trunk/src/java/net/sf/tacos/ajax/components/Autocompleter.jwc?view=markup
> > >
> > >
> > >     Of course all those additional parameters will be 'static' -
> > >     DirectLink has the same
> > >     'issue'.
> > >
> > >     My usual hack for this is to define a dummy placeholder parameter,
> > >     i.e. XXX
> > >     and use javascript to replace and rewrite the URL...
> > >
> > >     I've done something similar in tacos:DebugConsole, but please
> > >     don't tell anyone :)
> > >
> > >     If anyone knows a better solution, i'm all ears!
> > >
> > >     From Pedro Viegas <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>:
> > >
> > >     > Hi all,
> > >     >
> > >     > Been trying for sometime to get something like linked comboboxes
> > of
> > >     > dependant result sets.
> > >     > Something like having a combo with Directories and another Combo
> > >     with the
> > >     > current directory's files.
> > >     > I have been trying to add this funcionallity to the
> > >     Tacos:Autocompleter but
> > >     > it's getting very close to impossible.
> > >     > My goal is to have a simple to use enhanced Autocompleter with
> > >     by setting
> > >     > attributes can link to another AutoCompleter ou other components.
> > >     >
> > >     > What would be perfect was to be able to pass a second parameter
> > >     to the
> > >     > listener method instead of just the typed text.
> > >     > I have been unable to to this till now.
> > >     > I have been able to pass a new static parameter only by
> > >     overriding the
> > >     > Trigger method of the Tacos Autocompleter.java (witch forces
> > >     only the first
> > >     > parameter).
> > >     > Even like this I only could get a static parameter since the
> > >     submit is
> > >     > handled by the script.acul.uous Ajax.AutoCompleter widget and it
> > >     only
> > >     > receives a URL to start with.
> > >     > I found no event I could attach or change so I could add my URL
> > >     dynamic
> > >     > changes or some other solution.
> > >     >
> > >     > Been trying to get this working for more than a week. Could
> > >     really get some
> > >     > help by now! :-S
> > >     >
> > >     > Can anybody shed some light into this?
> > >     > Am I complicating things? If there is a better way to do this
> > >     please let me
> > >     > know.
> > >     >
> > >     > As I said all I want to do is to create a couple of components.
> > >     One a
> > >     > Autocompleter like component. The other a normal
> > PropertySelection.
> > >     > But both of them with a linked component property for passing
> > >     the filter to
> > >     > build the selection values from.
> > >     >
> > >     > One last thing... all of this the AJAX way of course. Something
> > the
> > >     > Tacos:Autocompleter does, and that is easy enought to build
> > >     > PropertySelection version of it.
> > >     >
> > >     > Thanks,
> > >     >
> > >     > --
> > >     > Pedro Viegas
> > >     >
> > >
> > >
> > >     --
> > >
> > >
> > >
> > >
> > >     -------------------------------------------------------
> > >     All the advantages of Linux Managed Hosting--Without the Cost and
> > >     Risk!
> > >     Fully trained technicians. The highest number of Red Hat
> > >     certifications in
> > >     the hosting industry. Fanatical Support. Click to learn more
> > >
> > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
> > >     <
> > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642>
> > >     _______________________________________________
> > >     Tacos-devel mailing list
> > >     [email protected]
> > >     <mailto:[email protected]>
> > >     https://lists.sourceforge.net/lists/listinfo/tacos-devel
> > >
> > >
> > >
> > >
> > > --
> > > Pedro Viegas
> >
> >
> > -------------------------------------------------------
> > All the advantages of Linux Managed Hosting--Without the Cost and Risk!
> > Fully trained technicians. The highest number of Red Hat certifications in
> > the hosting industry. Fanatical Support. Click to learn more
> > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
> > _______________________________________________
> > Tacos-devel mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/tacos-devel
> >
> 
> 
> 
> -- 
> Pedro Viegas
> 


-- 




-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
Tacos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tacos-devel

Reply via email to