Fix for AutocompleteExtender hiding selects in IE6?

Last post 11-26-2008 3:08 AM by abellix. 7 replies.

Sort Posts:

  • Fix for AutocompleteExtender hiding selects in IE6?

    05-31-2007, 10:17 AM
    • Star
      8,834 point Star
    • MorningZ
    • Member since 07-22-2002, 2:39 PM
    • Fort Lauderdale, FL
    • Posts 1,815

    I have the latest version of the ToolKit DLL and the AutocompleteExtender's div selection box is getting hidden below a select box i have right below the textbox

    Is there a way i can wire in a call to an existing javascript event i have in my project that will hide/show all the selects on the page when the div "pops up" and hides?     I remember reading in the past some fix about shimming in an iFrame under the popup div, but apparently this isn't written in there yet

     

    "If you make it idiot proof, they'll build a better idiot"
  • Re: Fix for AutocompleteExtender hiding selects in IE6?

    06-05-2007, 3:42 AM

     Hi,

    Please try to specify the z-index of the select control to -1.

    Hope this helps. 

  • Re: Fix for AutocompleteExtender hiding selects in IE6?

    06-05-2007, 8:00 AM
    • Star
      8,834 point Star
    • MorningZ
    • Member since 07-22-2002, 2:39 PM
    • Fort Lauderdale, FL
    • Posts 1,815

    IE 6 does not respect z-index on select boxes, that isn't the answer

    "If you make it idiot proof, they'll build a better idiot"
  • Re: Fix for AutocompleteExtender hiding selects in IE6?

    06-11-2007, 11:09 AM
    • Star
      8,834 point Star
    • MorningZ
    • Member since 07-22-2002, 2:39 PM
    • Fort Lauderdale, FL
    • Posts 1,815

    Well, I was hoping that version 10606 of the Toolkit addresses this serious issue, but sadly, no...

     

     

    Surely someone must know where to wire in an event to show/hide the <select> boxes when the AutoComplete's div tags shows/hides

     

    "If you make it idiot proof, they'll build a better idiot"
  • Re: Fix for AutocompleteExtender hiding selects in IE6?

    06-19-2007, 10:58 AM
    • Star
      8,834 point Star
    • MorningZ
    • Member since 07-22-2002, 2:39 PM
    • Fort Lauderdale, FL
    • Posts 1,815

    Just to close this issue in case anyone else runs across this thread looking for help, i fixed this myself and will document it here

    - Took the source for Toolkit version 10618
    - Opened it in studio and went to project "SampleWebSite", and opened file "App_Code/AutoComplete.js"
    - found the function named "hidePopup" and right below it added this function (~ line 360), which checks, albiet kinda "hack"-y, for IE 6 and hides or shows all select boxes

         hideSelects :
    function(i_Display) {
                if (typeof document.body.style.maxHeight == "undefined") {
                       
    var inputTags = document.getElementsByTagName('select');
                       
    for (var i=0; i < inputTags.length; i++) {
                                inputTags[i].style.visibility = i_Display;
                        }
                }
         },

        (don't forget that comma after the function is closed!

    - inside the "_hideCompletionList" function, i added "this.hideSelects('visible');" to the line right above "this.hidePopup();" (~ line 330)
    - inside the "_update" function, i added "this.hideSelects('hidden');" to the line right above "this.showPopup();" (~ line 770)
    - Built the website
    - Copied the AjaxControlToolkit.dll from this project into my own project

     

    Now when the CompletionList shows, it'll hide all the <select> boxes and show them again when the list hides

     

    "If you make it idiot proof, they'll build a better idiot"
  • Re: Fix for AutocompleteExtender hiding selects in IE6?

    06-19-2007, 11:07 AM
    • Star
      8,834 point Star
    • MorningZ
    • Member since 07-22-2002, 2:39 PM
    • Fort Lauderdale, FL
    • Posts 1,815

    i attached the fixed AutoCompete.cs file on this CodePlex issue item

    "If you make it idiot proof, they'll build a better idiot"
  • Re: Fix for AutocompleteExtender hiding selects in IE6?

    10-03-2008, 6:40 AM
    • Member
      3 point Member
    • suresh2mail
    • Member since 08-28-2008, 7:22 AM
    • Posts 1

    Still Iam facing the same prob. Can anyone help me on this

  • Re: Fix for AutocompleteExtender hiding selects in IE6?

    11-26-2008, 3:08 AM
    • Member
      4 point Member
    • abellix
    • Member since 11-22-2007, 9:20 AM
    • Posts 6

     Here my solution. I hope this could help someone Smile

     

    Here the js code (it should be IE6 targetized):

     

            function AutoComplete_OnClientShown(sender,args)
    {
    if(!iefix)return //ie6 only
    var oList = sender.get_completionList();
    var oSpan = oList.parentNode;
    var ifr = getChildObj(oSpan,"IFRAME");
    if(ifr)
    oSpan.removeChild(ifr); //remove any previous generated iframe
    ifr=document.createElement("IFRAME");
    oSpan.appendChild(ifr); //create the overlay iframe
    ifr.style.display="block";
    ifr.style.position="absolute";
    ifr.style.width = oList.style.width;
    ifr.style.height = oList.offsetHeight;
    ifr.style.left = oList.style.left;
    ifr.style.top = oList.style.top;
    }
    function AutoComplete_OnClientHiding(sender,args) {
    if(!iefix)return //ie6 only
    var oList = sender.get_completionList();
    var oSpan = oList.parentNode;
    var ifr = getChildObj(oSpan,"IFRAME");
    if(ifr)
    oSpan.removeChild(ifr);
    }
    function getChildObj(oCont,tag) {
    for(var i = 0; i < oCont.childNodes.length; i++) {
    if(oCont.childNodes[i].tagName == tag)
    return oCont.childNodes[i];
    }
    return false;
    }

     

    Now you must set the autocompleteextender properties to call the functions:

     

    ...
    OnClientShown="AutoComplete_OnClientShown"
    OnClientHiding="AutoComplete_OnClientHiding"
    ...

    In your CSS you must declare a z-index=1 to your completion list.
    If you set CompletionListCssClass="completionList" :

     

    .completionList 
    {
    z-index:1;
    }
      

     

    Alessio Bellisomi
Page 1 of 1 (8 items)