Forum Discussion

jyothi_pp_1's avatar
jyothi_pp_1
Occasional Contributor
11 years ago

Not able to select combo box items as Scrollbar not yet scrolled down

Hello,

We have a application form with long data fields. After entering values to the visible fields it should scroll down. But in our application it is not doing so.Scrollbar is not activated immediately. So once the visible fields are edited, it try to select values to the combo box item which is not visible.So our script fails to select the combo box item using the code oComboBox.ClickItem(szItem) .

While debugging , If we manually scroll down and make the field visible it works fine.

We cant use ScrollintoView function as the page is too long, and this control will not fall under,end of the page.



I tried using scrollobar.Keys["Down"]. But here the problem is above this combo box we were entering data for textbox.so the ctrl is in that combo box.So key press operation not working.

Can anyone help me to perform scroll operation?

Thanks in advance.

Jyothi
  • jorgesimoes1983's avatar
    jorgesimoes1983
    Regular Contributor
    Try to use scrollIntoView property, it works for me ;)



    http://msdn.microsoft.com/en-us/library/ms536730.aspx



    Another solution is to Add height values...



    obj.height + 200;



    You can use something like this:



    function scrollDown(n)

    {

      var scroll = Sys.Browser(Project.Variables.browser).Page("*").Panel("content").Panel("ibox").Panel("ibox_wrapper").Table(0).Cell(1, 0).Panel("ibox_content").Frame("ibox_framecontent").Panel("iBox_contentClip");

        

      if(scroll.Exists)

        scroll.scrollTop += n;

      else

        Log.Message("scroll not found");

    }