4 Replies Latest reply on Sep 16, 2010 9:03 PM by RKaster

    load mutiple stories

    HARISH1981

      Hi

       


      I have a

       

      <mx:List id="storyList" width="100%" dataProvider="{this.xxx.stories}" height="100%" variableRowHeight="true" selectable="true" useRollOver="true" borderStyle="none"
      itemRenderer="StoryRenderer" horizontalScrollPolicy="on" verticalScrollPolicy="auto" wordWrap="true">
      </mx:List>

       


      when i load multiple stories with a scrollbar, the stories gets collapsed, that is the stories get overlapped with other story texts...

       

      Thanks

        • 1. Re: load mutiple stories
          RKaster

          Hey Harish!

           

          Your problem is that your itemRenderer just needs some kind of layout. Put the content inside your itemRenderer, such as labels, buttons, text, or whatever in a containor like vgroup or something. Within the List component, between <s:list> </s:list>, give it a layout such as:

           

          <s:layout>

          <s:VerticalLayout

          </s:layout>

           

          That, my friend, should resolve your problem.

           

          In your example it would look like this:

           

           

          <mx:List id="storyList" width="100%" dataProvider="{this.xxx.stories}" height="100%" variableRowHeight="true" selectable="true" useRollOver="true" borderStyle="none"
          itemRenderer="StoryRenderer" horizontalScrollPolicy="on" verticalScrollPolicy="auto" wordWrap="true">

           

          <s:layout>

          <s:VerticalLayout

          </s:layout>


          </mx:List>

           

          If that doesn't work, I'll be happy to help you out more, but that should do it. I encountered this problem in the beginning myself.

          • 2. Re: load mutiple stories
            HARISH1981 Level 1

            Hi,

             

            i am using <mx:> controls, and i am unable to use <s:layout and <s:verticallayout inside the <mx:componentsss...

             

            second so i changed it to the following:

             

            <mx:List id="storyList" width="100%" dataProvider="{this.xxx.stories}" height="100%" variableRowHeight="true" selectable="true" useRollOver="true" borderStyle="none"
            itemRenderer="StoryRenderer" horizontalScrollPolicy="on" verticalScrollPolicy="auto" wordWrap="true">

             

             

            <mx:Panel>

            <mx:VBox></mx:VBox>

            </mx:Panel>

             


            </mx:List>

             

            but nothing inside this panel or vbox... is that correct?

             

            i am getting an error

             

            ---> Multiple initializers for property 'dataProvider'. (note: 'dataProvider' is the default property of 'mx.controls.List').

             

            Can you please help me?

            • 3. Re: load mutiple stories
              RKaster Level 1

              Ah, you're right, sorry that I missed that little detail. Then I'm guessing you're using Flex 3 as apposed to Flex 4/Flash Builder 4? If you're using the latter, I would suggest using a spark component instead of MX. Unfortunately I'm a little new to Flex myself, so Flex three is a little outside of my scope as I'm only familiar with Flex 4 development.

               

              I did do a little research however, and I don't think you can have a Panel inside of a list component, which might cause that kind of error. You can't have a container inside of the List component itself, but you can have it inside of the Item Renderer.

               

              Also, the solution is using a layout in a spark component, I'm not sure about MX really.

              • 4. Re: load mutiple stories
                RKaster Level 1

                I ran the same example as you with an Mx component and had no overlapping. Can I see your Item Render component to see what you did differently?