1 Reply Latest reply on Aug 11, 2008 5:52 AM by Newsgroup_User

    Cannot get width of checkbox in repeater

    LinkMc Level 1
      Hi,
      I am trying to get the width of my checkboxes in a repeater either during the "repeatEnd", where I create a loop over my items or during the "repeat".

      Here is my code

      <mx:Canvas id="rpForm" width="720" height="500">
      <mx:Repeater id="rp" dataProvider="{A00Skills}" repeat="removeLabel(event)" > <mx:Label id="fhSkill" text="{rp.currentItem.Module}" fontWeight="bold"/>
      <mx:Spacer id="spc" height="0"/>
      <mx:CheckBox id="cx" label="{rp.currentItem.SubModule}" y="20" x="0" minWidth="50"/>
      </mx:Repeater>
      </mx:Canvas>


      now I have tried in my function during repeatEnd or repeat to access my checkbox width and it is always 0. When I debug in flex builder I can go to cx --> inherited --> [0] --> x is 101 in with a green icon, but there is a yellow icon underneath it with 0, which is what I am getting.

      So how do I get the width of cx[1].width ?

      please help, Do I have a bug
        • 1. Re: Cannot get width of checkbox in repeater
          Level 7

          "LinkMc" <webforumsuser@macromedia.com> wrote in message
          news:g7n7hl$rkk$1@forums.macromedia.com...
          > Hi,
          > I am trying to get the width of my checkboxes in a repeater either during
          > the
          > "repeatEnd", where I create a loop over my items or during the "repeat".
          >
          > Here is my code
          >
          > <mx:Canvas id="rpForm" width="720"
          > height="500">
          > <mx:Repeater id="rp" dataProvider="{A00Skills}"
          > repeat="removeLabel(event)"
          >> <mx:Label id="fhSkill" text="{rp.currentItem.Module}"
          > fontWeight="bold"/>
          > <mx:Spacer id="spc" height="0"/>
          > <mx:CheckBox id="cx" label="{rp.currentItem.SubModule}" y="20" x="0"
          > minWidth="50"/>
          > </mx:Repeater>
          > </mx:Canvas>
          >
          >
          > now I have tried in my function during repeatEnd or repeat to access my
          > checkbox width and it is always 0. When I debug in flex builder I can go
          > to cx
          > --> inherited --> [0] --> x is 101 in with a green icon, but there is a
          > yellow
          > icon underneath it with 0, which is what I am getting.
          >
          > So how do I get the width of cx[1].width ?

          Try
          rp[0]cx.width;

          > please help, Do I have a bug

          Beyond my level of knowledge to answer ;-)