#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 )
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)
Change History (11)
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
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 13 years ago by
Component: | DojoX Data → Dijit |
---|---|
Description: | modified (diff) |
Milestone: | → 1.1 |
Owner: | changed from Jared Jurkiewicz to Douglas Hays |
Summary: | dojox.data.QueryReadStore - an option to make synchronized xhr calls → ComboBox: 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 13 years ago by
Owner: | changed from Douglas Hays to haysmark |
---|
comment:5 Changed 13 years ago by
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.
Changed 13 years ago by
Attachment: | 5970.patch added |
---|
comment:7 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Changed 13 years ago by
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 13 years ago by
comment:9 Changed 10 years ago by
Component: | Dijit → Dijit - Form |
---|
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.)