4 Replies Latest reply on Jun 24, 2008 3:22 PM by olimpiu.pop

    Problem with mx:List

    olimpiu.pop
      Hello,

      I`m new to Flex...and I`m trying to develop an application. At some point I print
      some information in a List (the list is encapsulated inside an Accordion). The
      problem I`m facing is that when I add an item that has the length longer then the
      length of the List no horizontal scroll is added. I tried to give one kind of settings
      to the scrollable property of the List...with no success.
      I hope you can help me with this.

      Thanks,
      Olimpiu
        • 1. Re: Problem with mx:List
          matthew horn Level 3
          Please post the source for an example that illustrates this behavior and I'll take a look.

          matt horn
          flex docs
          • 2. Re: Problem with mx:List
            peterent2 Adobe Employee
            The horizontal scrollbar will not automatically appear for the List (or the Tree, for that matter). The reason is that we don't want to have to instantiate an itemRenderer for each record and measure it to see how wide it will be to determine if a scrollbar is needed.

            For example, suppose you have 1000 records in your dataProvider. Every record except record 999 is completely visible without a scrollbar. The List only creates enough itemRenderers to show the visible rows (say 10 rows), but we would have to actually instantiate an itemRenderer for each row, 1000 of them, to determine that row 999 is too wide and the list should get a scrollbar.

            I'm afraid the solution is to set horizontalScrollPolicy="on". As the list is scrolls the scrollbar will change its size if an itemRenderer becomes too wide it fit the list and then it will change size once that itemRenderer moves out of view and is recycled to show another row.
            • 3. Re: Problem with mx:List
              olimpiu.pop Level 1
              quote:

              Originally posted by: danger42
              Please post the source for an example that illustrates this behavior and I'll take a look.

              matt horn
              flex docs


              I managed to obtain the scroll by using the horizontalScrollPolicy set to ON. But using this the scroll
              always appears. Is there a workaround for this?

              Olimpiu Thanks

              • 4. Re: Problem with mx:List
                olimpiu.pop Level 1
                Now it is much clearer. Thanks!