0 Replies Latest reply on Jul 10, 2007 10:40 PM by dkerr

    Nested Repeaters

    dkerr
      See this test page http://66.219.52.129/loops/bin/loops.html
      1 repeater works for tile buttons in first panel
      2 repeater works for accordion canvas in second panel
      But, when I try to nest 1 inside of 2, the buttons fail to load.

      Any ideas?

      I'm just trying to see if the nesting can work for now, But ultimately, there will be a relationship between the selected canvas and the buttons that appear within each. A panel may have many loops within it.

      I'm just trying to see if a repeater is the way to go. If there is an easier way, I'm open.

      See full source below.

      Thanks,
      Don


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

      <mx:Script>
      <![CDATA[

      import mx.controls.Alert;
      import mx.collections.ArrayCollection;
      import mx.rpc.events.ResultEvent;

      public function initApp():void {

      cfdata.getPanels();
      cfdata.getLoops();

      }

      public function Panels(event:ResultEvent):void
      {
      panelRepeat.dataProvider = event.result as ArrayCollection;
      panelRepeat2.dataProvider = event.result as ArrayCollection;
      }
      public function Loops(event:ResultEvent):void
      {
      loopRepeat.dataProvider = event.result as ArrayCollection;
      loopRepeat2.dataProvider = event.result as ArrayCollection;

      }
      ]]>
      </mx:Script>

      <mx:RemoteObject
      id="cfdata" showBusyCursor="true"
      destination="ColdFusion"
      source="loops.loops">
      <mx:method name="getPanels" result="Panels(event)" />
      <mx:method name="getLoops" result="Loops(event)" />
      </mx:RemoteObject>


      <mx:VBox>
      <mx:Panel title="works" paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10">
      <mx:Repeater id="loopRepeat">
      <mx:Tile direction="horizontal" borderStyle="inset"
      horizontalGap="10" verticalGap="15"
      paddingLeft="10" paddingTop="10" paddingBottom="10" paddingRight="10">
      <mx:Button
      height="49"
      width="50"
      label="{String(loopRepeat.currentItem.loop)}"/>
      </mx:Tile>
      </mx:Repeater>
      </mx:Panel>

      <mx:Panel title="works" paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10">
      <mx:Accordion width="200" height="200">
      <mx:Repeater id="panelRepeat">
      <mx:Canvas label="{String(panelRepeat.currentItem.panel)}"
      width="100%" height="100%">


      </mx:Canvas>
      </mx:Repeater>
      </mx:Accordion>
      </mx:Panel>

      <mx:Panel title="Tile inside accord no work" paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10">
      <mx:Accordion width="200" height="200">
      <mx:Repeater id="panelRepeat2">
      <mx:Canvas label="{String(panelRepeat2.currentItem.panel)}"
      width="100%" height="100%">

      <mx:Repeater id="loopRepeat2">
      <mx:Tile direction="horizontal" borderStyle="inset"
      horizontalGap="10" verticalGap="15"
      paddingLeft="10" paddingTop="10" paddingBottom="10" paddingRight="10" borderColor="#000000">
      <mx:Button
      height="49"
      width="50"
      label="{String(loopRepeat2.currentItem.loop)}"/>
      </mx:Tile>
      </mx:Repeater>
      </mx:Canvas>
      </mx:Repeater>
      </mx:Accordion>
      </mx:Panel>
      </mx:VBox>


      </mx:Application>