0 Replies Latest reply on Jan 6, 2007 11:11 AM by K.Arase

    Repeater bug?

    K.Arase
      When I make a complex layout with nested mx:Repeater,
      data binding does not work. Then, I try to force data
      binding by call container's executeBindings method.
      But, it breaks layout.
      It seems mx:Repeater's bug.

      Here is simple code shows problem.
      'add' button breaks layout and 'adjust' button fix it.

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="vertical">

      <mx:Script>
      <![CDATA[

      import mx.collections.ArrayCollection;

      [Bindable]
      private var outer : ArrayCollection = new ArrayCollection(
      ["a", "b", "c", "d", "e"]
      );

      [Bindable]
      private var inner : ArrayCollection = new ArrayCollection(
      [new Date()]
      );

      private function addItem() : void {
      inner.addItem(new Date() );
      executeBindings(true);
      }

      private function adjustItems() : void {
      outerRep.executeBindings(true);
      }

      ]]>
      </mx:Script>

      <mx:HBox>
      <mx:Button label="add" click="addItem()"/>
      <mx:Button label="adjust" click="adjustItems()"/>
      </mx:HBox>

      <mx:Repeater id="outerRep" dataProvider="{outer}">
      <mx:Repeater id="innerRep" dataProvider="{inner}">
      <mx:HBox>
      <mx:Label text="{outerRep.currentItem + '-' + innerRep.currentItem}"/>
      </mx:HBox>
      </mx:Repeater>
      </mx:Repeater>

      </mx:Application>