Ticket #853 (closed defect: fixed)
QAutocomplete remote JSON DataSource Problem after unsuccessful validation
| Reported by: | kon | Owned by: | somebody |
|---|---|---|---|
| Priority: | must | Milestone: | 2.1.1 |
| Component: | Javascript | Version: | 2.1.0 Stable |
| Keywords: | ajax autocomplete, data retrieval | Cc: |
Description
When I replaced a QListBox with an ajax-source QAutocomplete because there where thousands of entries and I didn't want to load them all at once, I noticed the following error:
When validation failed (for example too short or empty but required, etc.), then the autocomplete stopped working, giving a "undefined is not a function" error.
I tracked the problem down after hours of debugging and headaches that somehow the dataretrieval didn't work. I haven't yet found the cause of this, but found a solution nevertheless (see patch). With the patch applied the autocomplete continues to work after failed validations.
I also noted, that when i don't set the autocomplete's "Warning" property in the Validation function, then it also keeps working, even after failed validation. So it seems to me like the validation message causes something to go wrong. But somehow i can't see the whole picture yet.
I see that autocomplete saves data with the jquery "data" facilities and i think those get overwritten somehow by the returned xml. But via data('autocomplete') it is still available? I am confused and would love to understand this better!
Also i have made some changes in my source tree but the patch below is diffed against the latest 2.1 branch and should have the same effect.

