5 Replies Latest reply on May 24, 2010 5:41 AM by Jonas

    Problem with disappearing scrollbars


      I have a major problem with scrollbars disappearing in a Flex 4 project.

      The application have a number of (spark) list components.

      Some of them have the right behaviour and show scrollbars when needed, whereas others simply refuse to show any scrollbars.


      Have anyone else seen this behavior?

      Any tip on how to get around this problem is very appreciated.




        • 1. Re: Problem with disappearing scrollbars
          TeotiGraphix Level 3



          Can you give an example (simple) of a List that is not showing a scrollbar.


          Could be you data, how are you populating the Lists that don't show scrollbars?



          • 2. Re: Problem with disappearing scrollbars
            Jonas Level 1

            There is really nothing special with the list.
            A plain "vanilla" spark list (no skinning). The dataProvider of the list is bound to an ArrayCollection.
            New items are added to the ArrayCollection via addItemAt.
            The list updates OK, but there are no scrollbars.


            The whole thing is very strange. I have tried to tried to create a simple application to recreate the problem.
            But I can not reproduce it. I do not understand what is causing my problem.
            I think I have to rip my application apart and build it up from scratch.


            Thank for the help and interest.


            Now I have som demolition to do.

            • 3. Re: Problem with disappearing scrollbars
              Jonas Level 1

              I have tracked down the problem to the way I update the lists.


              As I described I have an ArrayCollection assigned to the dataProvider of the list. All updates of data is done directly to the ArrayCollection, via:

              myArrayCollection.addItemAt(newItem, index)


              or in the case of a completly new dataset

              myArrayCollection.source = someDataArray;


              (the list itself I leave untouched).

              When I do the above operations the itemRenderars update corerctly, but the list itself (or more correctly the layout of the list) does not realize that the dataProvider is updated.

              The result is missing scrollbars.


              I have another place in my application with basically the same set up a list, with a 4x4 tile layout.

              If I first load a dataset that fit within the first two rows of the list and then load another larger dataset (180 items), the list will still only show two rows and no scrollbars.

              However, if I touch the list (I have a slider that resizes the tiles), the list will properly update and show the full 4 rows and scrollbar.


              So somehow I need to get the List (or it's layout) to recognize that the dataProvider has changed and it need to invalidate its layout.

              I am not quite sure about the best way to accomplish this.


              Any tips or toughts?



              • 4. Re: Problem with disappearing scrollbars
                David_F57 Level 5



                have you done a refresh on your arraycollection after it is modified.  myArrayCollection.refresh().




                • 5. Re: Problem with disappearing scrollbars
                  Jonas Level 1

                  Yes, I have tried myArrayCollection.refresh().

                  But that did not help.