Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
None
-
Firefox 3, Linux.
Wicket 1.3.4.
Description
There is a Javascript error when using the autocomplete text field with preselect.
The error:
"element.firstChild is null"
The affected line is inside getSelectedValue():
var attr=element.firstChild.childNodes[selected].attributes['textvalue'];
How to reproduce:
1) Type something into the autocomplete text field. The javascript will send an Ajax request.
2) Hit enter quickly. When you hit it before the Ajax response arrives, the error occurs.
It is because the preselect sets selected=0, before sending the Ajax request.
It should be kept to -1 until the response arrives.
I'm going to attach a short patch for this.