0 Replies Latest reply on Mar 22, 2007 6:22 AM by dave7273

    Nesting Repeater Question

    dave7273 Level 1
      Help!!!

      Here's the situation. I have two Array Collections that are related. The first Array Collection is a list of regions, the second is a list of cities within the region. To do this, I have the first repeater render the checkbox for the region, and then the second repeater take the currentindex of the first repeater to use it to grab the cities associated with it. The city Array is a three dimenional array. Array[region#][cityData][cityLabel]. The first element in the region has no cities associated with it so having that as my zero element works fine.

      It looks like there are issues with using the currentIndex property of a repeater to be the databinding for a nested repeater. These are from two different ArrayCollections, not the same one.

      The city checkboxes do get rendered if I hardcode the index number in the dataprovider of the second repeater, but cannot use the rpt1.selectedIndex property. That property is valid and have verified that it is getting set properly.

      Here's the code....This did work ok in Flex 1.5

      <mx:Repeater id="rpt1" dataProvider="{objRegiontList}" >
      <mx:HBox x="0">
      <mx:HBox width="180">
      <mx:CheckBox id="chkDistrict" label="{rpt1.currentItem.label}" click="checkDistrict(event.target.getRepeaterItem());changeFlag=true;" styleName="lblBold" />
      </mx:HBox>


      <mx:Repeater id="rpt2" dataProvider="{objCityList.getItemAt(rpt1.currentIndex)}">
      <mx:HBox width="70">
      <mx:CheckBox toolTip="{rpt2.currentItem.label}" id="chkOffice" label="{rpt2.currentItem.data}" click="checkOffice(event.target.getRepeaterItem());changeFlag=true;" />

      </mx:HBox>
      </mx:Repeater>
      </mx:HBox>
      </mx:Repeater>