Sorry about that tracy, I think the reason for me getting 0 on my width and
height is the controls are not created on screen yet, and the width and
height will change when they are displayed. I was trying to get the natural
width and height. So once checkbox could be 160 while another would be 250.

 

The reason is I wanted to make a checkbox selection list based on combobox
selection and each section has their own topic section: see below

 

I tried tile, tilelist, grid, etc. The only one that could make this was the
Canvas. 

 

module 1

[ ] submodule      [ ]submodule     [ ]submodule

[ ]submodule       [ ]submodule     [ ]submodule

 

Module 2

[ ] submodule      [ ]submodule     [ ]submodule

[ ]submodule       [ ]submodule     [ ]submodule

 

Just to let everyone know, I kind have a solution. But the reason for me
needing my width was to position my checkboxes closer to the previous one.
The would compact my layout better.

 

Thanks Link

 

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Tracy Spratt
Sent: Monday, August 11, 2008 12:36 PM
To: [email protected]
Subject: RE: re[flexcoders] peater checkbox width is alway 0

 

I don't have a suggestion to your question directly, but.

 

Repeater is a great tool, but using it like that can be difficult.  I
suggest you create a custom component, implementing a public property into
which you pass the entire currentItem.  This allows you to code the repeated
content much more normally.  For example, you can use the normal component
lifecycle events like creationComplete, and can dispatch events, and the
handler can access the dataProvider item without that silly getRepeaterItem
stuff.  Internal code can access child components by normal id references.

 

You don't say what you need to width for or why you are looping, but
consider this technique and it might solve one or more of your problems.

 

Tracy

 

  _____  

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Link Mckinney
Sent: Sunday, August 10, 2008 4:06 PM
To: [email protected]
Subject: re[flexcoders] peater checkbox width is alway 0

 


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

-- 
View this message in context:
http://www.nabble.com/repeater-checkbox-width-is-alway-0-tp18915199p18915199
.html
Sent from the FlexCoders mailing list archive at Nabble.com.

 

Reply via email to