[OpenLayers-Dev] Openlayers and scriptaculous autoComplete
crschmidt at metacarta.com
Sun May 13 12:41:05 EDT 2007
On Sun, May 13, 2007 at 11:39:09AM +0300, Ehud Shabtai wrote:
> I'm trying to use openlayers along with a form which uses the
> Ajax.autoComplete of scriptaculus.
> I can't make it work properly, as the autoComplete always shows me the first
> batch of results regardless of the input.
> It seems that Openlayers intercepts the ajax response from the server in its
> Function.prototype.bind definition which defines function(moreargs).
> function(moreargs) is called for every response from the server and it
> appends the response into the args array. So my args array now contains all
> of the autoComplete responses (which are not valid anymore as only the last
> response contains the correct set). When it passes this array further down
> to scriptaculus, scriptaculus only uses the first response as it does not
> expect an array. So I always get the same batch of completions.
> Can I avoid Openlayers intercepting the autoComplete responses?
I don't think so. Does this mean that our definition of Function.bind is
different from that in Prototype somehow? Looking at the code, it seems
like the end result of the current (Prototype 1.5.1) definition and our
current definition in OpenLayers should end up being the same...
I can't figure out why this is happening (though I know it is, because I
ran into the same thing recently). Do you feel like you understand it
and see what we're doing wrong?
More information about the Dev