Author: jcompagner
Date: Fri May 30 04:33:14 2008
New Revision: 661657

URL: http://svn.apache.org/viewvc?rev=661657&view=rev
Log:
WICKET-1659: Prolem with 'mouseactive' in wicket-autocomplete.js when 
AutoCompleteBehaviour is added (twice) during Ajax roundtrip

Modified:
    
wicket/branches/wicket-1.3.x/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/wicket-autocomplete.js

Modified: 
wicket/branches/wicket-1.3.x/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/wicket-autocomplete.js
URL: 
http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/wicket-autocomplete.js?rev=661657&r1=661656&r2=661657&view=diff
==============================================================================
--- 
wicket/branches/wicket-1.3.x/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/wicket-autocomplete.js
 (original)
+++ 
wicket/branches/wicket-1.3.x/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/wicket-autocomplete.js
 Fri May 30 04:33:14 2008
@@ -57,7 +57,16 @@
        // it is computed when the menu is first rendered, and then reused.
        var initialDelta = -1;
 
-    function initialize(){     
+    function initialize(){
+               // Remove the autocompletion menu if still present from
+               // a previous call. This is required to properly register
+               // the mouse event handler again (using the new stateful 
'mouseactive'
+               // variable which just gets created)
+        var choiceDiv=document.getElementById(getMenuId());
+        if (choiceDiv != null) {
+            choiceDiv.parentNode.parentNode.removeChild(choiceDiv.parentNode);
+        } 
+               
         var obj=wicketGet(elementId);
 
         objonkeydown=obj.onkeydown;


Reply via email to