Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 08-29-2007, 04:28 PM   #1
chad
Flash Developer
 
chad's Avatar
 
Join Date: Jun 2006
Posts: 74
Exclamation Repeated Checkbox Will Not Bind

I have a Repeater that creates a dynamic number of CheckBoxs. This Repeater is also within a Repeater. I have the selected value of the CheckBox bound to a (bindable) boolean variable. When I change the value of the variable, the selected value of the CheckBox does not change. If I bind something else to that boolean OUTSIDE of the Repeater (try uncommenting the checkbox below the button to see what i mean), then the CheckBox's selected property will change...but ONLY if I bind to the boolean outside of the Repeater as well. Also, if the CheckBoxs were only within 1 repeater (not a nested repeater) then it will function as you expect, but its the nested repeater that seems to be the source of the problem. What could cause this behavior and what could be done to solve the problem?

Thanks

Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
    xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="vertical" 
    width="900" height="700">
    
   <mx:Script>
       <![CDATA[
			[Bindable]private var bool:Boolean=false;
       ]]>
   </mx:Script>
   
	<mx:Button label="bool" click="bool=!bool;"/>
	<!--<mx:CheckBox label="uncommenting this also fixes it" selected="{bool}"/> -->
	
	<mx:Repeater dataProvider="{[1]}">
		<mx:Repeater dataProvider="{[1,2,3]}" >
			<mx:CheckBox label="test" selected="{bool}"/>
		</mx:Repeater>
	</mx:Repeater>
</mx:Application>

Last edited by chad; 08-29-2007 at 04:31 PM.
chad is offline   Reply With Quote
Old 08-29-2007, 05:05 PM   #2
dr_zeus
Feathers
 
dr_zeus's Avatar
 
Join Date: Mar 2005
Location: Silicon Valley
Posts: 1,999
Default

I haven't tested it, so I may be wrong, but try this:

Code:
<mx:Repeater dataProvider="{[1,2,3]}" >
	<mx:CheckBox label="test" selected="{outerDocument.bool}"/>
</mx:Repeater>
__________________
Josh Tynjala | Feathers
dr_zeus is offline   Reply With Quote
Old 08-29-2007, 07:14 PM   #3
chad
Flash Developer
 
chad's Avatar
 
Join Date: Jun 2006
Posts: 74
Default

This did not work. It says that outerDocument is an undefined property. This is not a problem with accessing the bool, it does have access to it. The problem is that the nested repeater checkbox is not receiving property change events. Any other ideas?
chad is offline   Reply With Quote
Old 08-29-2007, 08:32 PM   #4
dr_zeus
Feathers
 
dr_zeus's Avatar
 
Join Date: Mar 2005
Location: Silicon Valley
Posts: 1,999
Default

Sorry, I guess I read your post too quickly. I thought you couldn't bind to bool at all.

After trying out many different ideas, I get the feeling that you've found a bug in the framework. Perhaps the bindings don't get set up properly because the Repeaters take too long to create the CheckBoxes? It's very strange.
__________________
Josh Tynjala | Feathers
dr_zeus is offline   Reply With Quote
Old 08-29-2007, 08:58 PM   #5
chad
Flash Developer
 
chad's Avatar
 
Join Date: Jun 2006
Posts: 74
Default

I think that you're right in that it is a flex bug. I checked the bug reports and found a bug report that describes exactly my problem. Thanks for your help.
chad is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Checkbox text align sonic_2k_uk Components 0 06-28-2007 12:20 PM
checkbox component (label not setting) silentweed Components 1 07-19-2006 12:54 PM
using the checkbox component w. MX greenplasticcup Components 20 06-22-2006 07:43 PM
show checkbox on certain datagrid rows sonofkyuss Components 0 06-09-2006 01:53 AM
Checkbox component inside movieclip...how to click the checkbox? mrand01 ActionScript 2.0 3 04-08-2004 07:52 PM


All times are GMT. The time now is 05:12 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.