AutoCompleteExtender moves when i type in the textbox

Last post 09-01-2008 9:30 AM by rtpHarry. 5 replies.

Sort Posts:

  • AutoCompleteExtender moves when i type in the textbox

    08-31-2008, 4:00 AM
    • Member
      10 point Member
    • RonyVain
    • Member since 08-02-2006, 12:14 PM
    • Posts 12

      Normal 0 false false false EN-US X-NONE HE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin;}

    Hi,

    i have a application that uses ajax.net . the aspx page inherits from masterpage.

    i am using AutoCompleteExtender to enable autocomplete in my application, and it works.

    the problem is when i start typing in the textbox , the autocomplete list moves and not exactly under the textbox.

    i tried to place it manually by using OnClientShown  = "AutoCompleteSearch_Show", and i do get the event but when i try to re- locate the list it still moves.

    for examle:

     

    function AutoCompleteSearch_Show(sender,args) // sender is the list

    {

    var oParent = $get('SearchBox');  //my textbox

    var offesetLeft = 0; while (oParent!=null)
    {

          offesetLeft+=oParent.offsetLeft;

          oParent = oParent.offsetParent;

    }

    sender.style.left = offsetLeft;

    }

    and for example the result is 510px.

    and still the list moves, but if i give  to the list sender.style.left = '560px' the list stops to move.

    i checked the content of offesetLeft and it is '510px' .

    * i do see that the result in the offsetLeft is not the 560px , but if i receive 510px i  expect the list to stay on this position and not to move,( may be the way i calculate the position is wrong  ).

     

     

    second problem :

     

    i am using internet explorer 6 with sp1 .

    and there is a bug in this version , when div on listbox or dropdown the listbox is shown and not the div.

     

    i now that in this  case i need to use iframe and on the iframe to show the div.

    this problem exists  in the AutoComplereExtender , and i found the solution in the internet

    http://www.codeplex.com/AjaxControlToolkit/WorkItem/View.aspx?WorkItemId=15826

    but , it doesn't work.

    i think the reason is  connected to the first problem, because when i run the following code the iframe does not moves to the potision of the list.

     

    the code:

    function AutoCompleteSearch_Show(sender,args)

    {

    var oList  = sender.get_completionList();

    var oSpan = GetMainSpan(oList);

    var iframe  = oSpan.getElementsByTagName('IFRAME')[0];

    iframe.style.width = oList.style.width;

    iframe.style.height = oList.style.height; }

     

    function GetMainSpan(oObj)

    {

    var oParent = oObj.parentElement;

    while (oParent.tagName!='SPAN')

    {

    oParent = oParent.parentElement;

    return oParent;

    }

    }

     

     

    i am working on internet explorer 6 sp1 and windows 2003 sp1 with vs 2005 AjaxToolKit v 3.5 and System.Web.Extensions v 1.

     

    waiting to yours suggestions.

     

    p.s i tried to open new web project and connected autocompleteextender to textbox, and without any changes it worked.

     

    Thanks , Rony

  • Re: AutoCompleteExtender moves when i type in the textbox

    08-31-2008, 5:43 AM
    • All-Star
      36,264 point All-Star
    • rtpHarry
    • Member since 10-01-2006, 8:51 AM
    • Lincoln, England
    • Posts 5,835

    Is your code online anywhere that we could test it for you?

    Have you tried running it through a validator?

    Have you tried renaming the control or moving it around in the document to stop naming collisions or css cascading down to your control.

    If it works in a new project without modification then the problem isnt your autocompleteextender its something thats further up the dom.

  • Re: AutoCompleteExtender moves when i type in the textbox

    08-31-2008, 8:00 AM
    • Member
      10 point Member
    • RonyVain
    • Member since 08-02-2006, 12:14 PM
    • Posts 12

     no my code is not online.

    what do you meen by validator?

    and the problem is not in the naming collision , i checked that.

    i tried to test it on other computers and the result is the same.

     

  • Re: AutoCompleteExtender moves when i type in the textbox

    08-31-2008, 11:40 AM
    • All-Star
      36,264 point All-Star
    • rtpHarry
    • Member since 10-01-2006, 8:51 AM
    • Lincoln, England
    • Posts 5,835

    By validator I meant a html validator such as the one at w3c.

     http://validator.w3.org/

    It was just to check for naming collisions to see what else could be causing it to move.

    If you get Firefox and then get the Firebug extension you can click inspect and see what css rules are being applied to it.

  • Re: AutoCompleteExtender moves when i type in the textbox

    08-31-2008, 5:05 PM
    • Member
      10 point Member
    • RonyVain
    • Member since 08-02-2006, 12:14 PM
    • Posts 12

     thanks,

    but my working computer is disconnected from the internet, and i used the same tool as firefox have but on internet explorer (ie for developers) he do the same thing.

    i think the problem is in the css but  i can't find the reason for this error.

     

  • Re: AutoCompleteExtender moves when i type in the textbox

    09-01-2008, 9:30 AM
    Answer
    • All-Star
      36,264 point All-Star
    • rtpHarry
    • Member since 10-01-2006, 8:51 AM
    • Lincoln, England
    • Posts 5,835

     Hmm sounds like its going to be tricky then. All I can suggest is that you take bits in and out of your page until you can isolate what is causing the problem.

Page 1 of 1 (6 items)