3 Replies Latest reply on May 14, 2008 9:14 PM by limitedwave777

    Paging an image repeater?

    limitedwave777
      Hello! I have this code which pumps some data into an array from a loop in the function. I cannot figure out what I need to do to hook this up to my repeater. Code:

      I've been using the {acSlides} as my dataprovider on my repeater, inside a tiler. I see this paging system uses an Array Collection first, then pulls pages from it. I'm just wondering what path I should be on. Should I be figuring out how to use paging from my existing ArrayCollection, or should I make a new one? This is really confusing! All the samples I see say "I did it for an xxx but you can do it on a xxx or xxx or anything" but being new to Flex, I'm not sure how the principles apply maybe? Help!

      [Bindable] private var acSlides:ArrayCollection;

      private function resultHandler(event:ResultEvent) :void
      {
      acSlides = event.result.response.data.row;
      initApp();
      }

      //***************************************************************************************

      [Bindable]private var orgData:ArrayCollection = new ArrayCollection();
      [Bindable]private var nav:ArrayCollection = new ArrayCollection();
      [Bindable]private var currentPage:Number = 0;
      [Bindable]private var pageSize:uint = 10;
      [Bindable]private var navPage:uint = 1;
      [Bindable]private var navSize:uint = 10;

      private function InitApp():void{
      for( var x:uint = 1; x <= 500; x++ ){
      var obj:Object = new Object();
      obj.Id = x.toString();
      obj.Name = "Column " + x.toString();
      obj.Street = "5555 Street";
      obj.Title = "CEO";
      obj.City = "El Paso";

      orgData.addItem(obj);
      }
      }
        • 1. Re: Paging an image repeater?
          limitedwave777 Level 1
          The rest of the code:

          <utils:FXCPager id="fxcPager" pageIndex="{currentPage}" pageSize="{pageSize}" dataProvider="{orgData}" />

          <mx:VBox verticalGap="0">

          <mx:DataGrid id="fxc_dg" dataProvider="{fxcPager.pageData}" width="600"/>

          <mx:VBox horizontalAlign="center" width="{fxc_dg.width}" >

          <controls:FXCPagerBar
          id="fxc_pageNav2"
          pager="{fxcPager}"
          totalPages="{Math.ceil(orgData.length/pageSize)}"
          maxVisiblePages="{navSize}"
          buttonWidth="40"
          buttonMode="true"/>

          <mx:NumericStepper value="{this.pageSize}" change="this.pageSize = event.target.value" maximum="500"/>
          </mx:VBox>

          </mx:VBox>
          • 2. Re: Paging an image repeater?
            ntsiii Level 3
            I do not understand your question. I do not see any reapeater anywhere in the code you post.

            what do you mean by "...hook this up to my repeater..."?

            To page a repeater, you set its startingIndex and count properties.

            Tracy
            • 3. Re: Paging an image repeater?
              limitedwave777 Level 1
              Fixed...I set the dataProvider for the fxcPager to be my ArrayCollection, that worked. fxPager component s great.