1 Reply Latest reply on Mar 2, 2010 12:44 AM by Anton Pierhagen

    GetFocus and scroll down bar's

    Anton Pierhagen Level 1

      Hi all

       

      I have a question. I have made a application in FLEX which uses a tabnavigator.

       

      In all of the tab's there are inputfields which the users can fill in.

       

      In one of the tab's i have made a button which add's several more inputfields on a tab.

      And the new inputfields are set below the existing ones.

       

      Often, the new inputfields and the old inputfields don't fit on the screen, so a scrollbar appears and the user have to scroll down to see the new fields.

       

      I would like to add a function at the click event of the button so the scrolling down to the new fields will be done automatically.

      But i haven't found anything that can make this happen in FLEX.

       

      I tried it with the function SetFocus to one of the new fields, but it won't work. I think it won't work because the setFocus method thinks that the user is on the right place, because the button and the new fields are on the same tab of the tabnavigator and it won't do anything with the scrollbar which appears because the screen is to small for all the new fields

       

      Does anyone has a solution for it?

       

      Kind regards,

       

      Anton Pierhagen

        • 1. Re: GetFocus and scroll down bar's
          Arun Lal Level 2

          If the new textInputs are added at the bottom of the container, then try this to move the scroll

           

          container.verticalScrollPosition = container.maxVerticalScrollPosition;

           

          to set the focus;

           

          after addChild();

           

          newtextInput.setFocus();

           

          Try this and let me know if it helped

          1 person found this helpful