Opened 12 years ago

Closed 12 years ago

Last modified 9 years ago

#5970 closed defect (fixed)

ComboBox: with autocomplete=true, race condition when typing too fast

Reported by: guest Owned by: haysmark
Priority: high Milestone: 1.1
Component: Dijit - Form Version: 1.0
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

there is an example for using it with FilteringSelect? here: http://www.dojotoolkit.org/book/book-dojo/part-3-javascript-programming-dojo-and-dijit/using-dojo-data/available-stores/dojox-d

as a result of each server request the text in the FilteringSelect? is being replaced, and if the user types too fast (actually while the server request is on the go), it messes up the text in the FilteringSelect?.

Attachments (2)

5970.patch (527 bytes) - added by haysmark 12 years ago.
Fixes #5970. Addresses regression in [9579] in ComboBox? enabling old dojo.data queries to incorrectly replace the user's input.
5970.2.patch (2.6 KB) - added by haysmark 12 years ago.
Fixes #5970. Set lastQuery sooner so that the user's text is not overwritten when an old query returns before the searchDelay expires.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 12 years ago by bill

Synchronous requests are almost never a good idea, since the lock up the UI. ComboBox? shouldn't fail just because the user keeps typing while the XHR is executing. Can you be more specific than "it messes up the text"? What happens exactly? (You can give an example.)

comment:2 Changed 12 years ago by guest

i have a list of the cities in israel.

when i type: "GO", i get the following list in the popup: GONEN GOREN GRANOT HAGALIL

at this moment, the text in the input is: "GONEN", while "NEN" (the last 3 letters) are selected.

BUT: if i type: "GO" too fast, the text in the input is "GONEN" (as expected), but the WHOLE word is selected. the next momet i type "R" (the third letter of "GOREN") and the whole text in the input is replaced by "R"...

from the client point of view it's almost identical to the nominted example. the only difference is that i used requestMethod="post" (instead of requestMethod="get"). i don't think it should make any difference, right?

at the server side i have a servlet that parse the "postData", and response with the appropriate JSON-formated result.

i hope this helps, and i'll be happy to supply more info in case needed. ewilde.

comment:3 Changed 12 years ago by bill

Component: DojoX DataDijit
Description: modified (diff)
Milestone: 1.1
Owner: changed from Jared Jurkiewicz to Douglas Hays
Summary: dojox.data.QueryReadStore - an option to make synchronized xhr callsComboBox: with autocomplete=true, race condition when typing too fast

Hi ewilde, thanks for that explanation, that's pretty good. It shouldn't matter whether you use GET or POST, but I suppose that affecting some sort of race condition. I'm considering this a bug with ComboBox?, so setting as a dijit bug.

comment:4 Changed 12 years ago by Douglas Hays

Owner: changed from Douglas Hays to haysmark

comment:5 Changed 12 years ago by guest

that's fine, but don't you think it might be good to pass (at least some of) the xhr-request object as parameter? it might be good for example in case you want other exchange formats (and you don't want to copy most of the QueryReadStore? ), or setting the encoding. i'm not familier enough with the whole architecture, but maybe you need more general class, to be an ancestor for QueryReadStore?, and potentialy others.

comment:6 Changed 12 years ago by haysmark

Regression in [9579].

Changed 12 years ago by haysmark

Attachment: 5970.patch added

Fixes #5970. Addresses regression in [9579] in ComboBox? enabling old dojo.data queries to incorrectly replace the user's input.

comment:7 Changed 12 years ago by Douglas Hays

Resolution: fixed
Status: newclosed

(In [12727]) Fixes #5970. Proxy commit for haysmark. Addresses regression in [9579] in ComboBox?? enabling old dojo.data queries to incorrectly replace the user's input.

Changed 12 years ago by haysmark

Attachment: 5970.2.patch added

Fixes #5970. Set lastQuery sooner so that the user's text is not overwritten when an old query returns before the searchDelay expires.

comment:8 Changed 12 years ago by Douglas Hays

(In [12764]) References #5970. Proxy commit for haysmark. Set lastQuery sooner so that the user's text is not overwritten when an old query returns before the searchDelay expires.

comment:9 Changed 9 years ago by bill

Component: DijitDijit - Form
Note: See TracTickets for help on using tickets.