0 Replies Latest reply on Oct 2, 2007 1:00 PM by hale2jo

    Repeater and Button Problem

    hale2jo
      Hi, everybody. I'm trying to use a Repeater to create a set of Buttons. But, all that will display is one Button when there should be 10. Here's my code:

      [Bindable]
      [ArrayElementType("DeviceObject")]
      public var deviceObjList:Object;
      ....

      deviceObjList is populated.....

      ....

      <mx:Canvas id="mainCanvas" height="100%" width="100%" autoLayout="true" visible="true">
      <mx:VBox id="mainMenuVBox" top="0" left="0" verticalGap="10">
      <mx:Repeater id="deviceButtonsRepeater" dataProvider="{deviceObjList}">
      <mx:Button id="deviceButton"
      width="{buttonWidth}" height="{buttonHeight}"
      toolTip="{deviceButtonsRepeater.currentItem.toolTip}"
      label="{deviceButtonsRepeater.currentItem.label}"
      icon="{deviceButtonsRepeater.currentItem.icon}"
      visible="true" click="deviceClickHandler(event)"
      />
      </mx:Repeater>
      </mx:VBox>
      </mx:Canvas>

      Does anyone know what I'm doing wrong?
      Thanks in advance!
      Josephine

      P.S. Before I had this:

      <mx:Canvas id="mainCanvas" height="100%" width="100%" autoLayout="true" visible="true">
      <mx:VBox id="mainMenuVBox" top="0" left="0" verticalGap="10">
      <mx:ButtonBar id="menuDeviceButtonBar"
      top="0" left="0"
      direction="vertical" verticalGap="{menuDeviceButtonGap}"
      dataProvider="{deviceObjList}" childAdd="setIcon()"
      buttonHeight="{buttonHeight}" buttonWidth="{buttonWidth}"
      itemClick="deviceClickHandler(event)" visible="true"/>
      </mx:VBox>
      </mx:Canvas>

      and that works great.....(I don't want to use the ButtonBar anymore because I need to be able to move the Buttons on their own.)