<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.1" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Using a CheckBox control as a list item renderer in Flex</title>
	<link>http://blog.flexexamples.com/2008/01/27/using-a-checkbox-control-as-a-list-item-renderer-in-flex/</link>
	<description>A bunch of examples for Adobe Flex and ActionScript</description>
	<pubDate>Thu, 28 Aug 2008 13:55:59 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.1</generator>

	<item>
		<title>By: RamMohan</title>
		<link>http://blog.flexexamples.com/2008/01/27/using-a-checkbox-control-as-a-list-item-renderer-in-flex/#comment-14212</link>
		<author>RamMohan</author>
		<pubDate>Fri, 18 Jul 2008 05:25:09 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/01/27/using-a-checkbox-control-as-a-list-item-renderer-in-flex/#comment-14212</guid>
		<description>I have used this Multi-Selected Checkbox, but i wants to display selected checkboxes and as well as which one is not selected checkboxes in jsp code one page to another page .

Can anyone please supply/guide me with the code.







	
                                    	
                                        	* Select the checkbox for those students who are present, for absentees do not select.
                                        
                                        
                                        	
                                            Student Name
                                            Leave Applications
                                        
                                        
                                        	
                                        	pavan pavan
                                        	-
                                        
                                        
                                        	
                                        	Prasad Rao-
                                        
                                        
                                        	Ramesh Shrestha
                                        	-
                                        
                                        
                                        	
                                        	satish india-
                                        
                                        
                                        	
                                        	star starworld-
                                        
                                        
                                        	
                                        	Vikas Verma-
                                        
                                          
                                            &#160;                                    
                                            
                                            &#160;
                                        
                                   
                                 
                               
                               
                               		
                               
                          

</description>
		<content:encoded><![CDATA[<p>I have used this Multi-Selected Checkbox, but i wants to display selected checkboxes and as well as which one is not selected checkboxes in jsp code one page to another page .</p>
<p>Can anyone please supply/guide me with the code.</p>
<p>                                        	* Select the checkbox for those students who are present, for absentees do not select.</p>
<p>                                            Student Name<br />
                                            Leave Applications</p>
<p>                                        	pavan pavan<br />
                                        	-</p>
<p>                                        	Prasad Rao-</p>
<p>                                        	Ramesh Shrestha<br />
                                        	-</p>
<p>                                        	satish india-</p>
<p>                                        	star starworld-</p>
<p>                                        	Vikas Verma-</p>
<p>                                            &nbsp;                                    </p>
<p>                                            &nbsp;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: RamMohan</title>
		<link>http://blog.flexexamples.com/2008/01/27/using-a-checkbox-control-as-a-list-item-renderer-in-flex/#comment-14211</link>
		<author>RamMohan</author>
		<pubDate>Fri, 18 Jul 2008 05:23:09 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/01/27/using-a-checkbox-control-as-a-list-item-renderer-in-flex/#comment-14211</guid>
		<description>I have used this Multi-Selected Checkbox, but i wants to display selected checkboxes and as well as which one is not selected checkboxes in jsp code one page to another page .

Can anyone please supply/guide me with the code.</description>
		<content:encoded><![CDATA[<p>I have used this Multi-Selected Checkbox, but i wants to display selected checkboxes and as well as which one is not selected checkboxes in jsp code one page to another page .</p>
<p>Can anyone please supply/guide me with the code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bharathi</title>
		<link>http://blog.flexexamples.com/2008/01/27/using-a-checkbox-control-as-a-list-item-renderer-in-flex/#comment-13659</link>
		<author>Bharathi</author>
		<pubDate>Wed, 25 Jun 2008 19:51:26 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/01/27/using-a-checkbox-control-as-a-list-item-renderer-in-flex/#comment-13659</guid>
		<description>Hi ,
I am very new to Flex. I want to do the same thing with Checkbox but i need it to display horizontally , how can I do it? 

Please help
Bharathi</description>
		<content:encoded><![CDATA[<p>Hi ,<br />
I am very new to Flex. I want to do the same thing with Checkbox but i need it to display horizontally , how can I do it? </p>
<p>Please help<br />
Bharathi</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nik</title>
		<link>http://blog.flexexamples.com/2008/01/27/using-a-checkbox-control-as-a-list-item-renderer-in-flex/#comment-11260</link>
		<author>Nik</author>
		<pubDate>Tue, 08 Apr 2008 16:16:20 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/01/27/using-a-checkbox-control-as-a-list-item-renderer-in-flex/#comment-11260</guid>
		<description>thanks for the code - I used it to create a very long list of items and had some trouble with the events. It ends up picking up scroll events too and so checkboxes end up getting random states.

I fixed it with changing your onChange fn to;

private function onChange(evt:Event):void {
   data.isSelected = selected;
}

so that it used the new checkbox state rather than assuming a state change. Hopefully that wan't a dumb thing to do (worked at least).

Nik</description>
		<content:encoded><![CDATA[<p>thanks for the code - I used it to create a very long list of items and had some trouble with the events. It ends up picking up scroll events too and so checkboxes end up getting random states.</p>
<p>I fixed it with changing your onChange fn to;</p>
<p>private function onChange(evt:Event):void {<br />
   data.isSelected = selected;<br />
}</p>
<p>so that it used the new checkbox state rather than assuming a state change. Hopefully that wan&#8217;t a dumb thing to do (worked at least).</p>
<p>Nik</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vijay</title>
		<link>http://blog.flexexamples.com/2008/01/27/using-a-checkbox-control-as-a-list-item-renderer-in-flex/#comment-7535</link>
		<author>Vijay</author>
		<pubDate>Thu, 13 Mar 2008 19:59:18 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/01/27/using-a-checkbox-control-as-a-list-item-renderer-in-flex/#comment-7535</guid>
		<description>Hello Friends,

I have used this Multi-Selected Checkbox, but finding it difficult to write a function which does Select-All or Deselects All.

Can anyone please supply/guide me with the code.

Appreciate the help.

Regards,
Vijay</description>
		<content:encoded><![CDATA[<p>Hello Friends,</p>
<p>I have used this Multi-Selected Checkbox, but finding it difficult to write a function which does Select-All or Deselects All.</p>
<p>Can anyone please supply/guide me with the code.</p>
<p>Appreciate the help.</p>
<p>Regards,<br />
Vijay</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pratap</title>
		<link>http://blog.flexexamples.com/2008/01/27/using-a-checkbox-control-as-a-list-item-renderer-in-flex/#comment-7453</link>
		<author>Pratap</author>
		<pubDate>Mon, 10 Mar 2008 07:40:30 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/01/27/using-a-checkbox-control-as-a-list-item-renderer-in-flex/#comment-7453</guid>
		<description>any idea how to write following code using ActionScript??







Thanks in Advance....Pratap</description>
		<content:encoded><![CDATA[<p>any idea how to write following code using ActionScript??</p>
<p>Thanks in Advance&#8230;.Pratap</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nathanael Jones</title>
		<link>http://blog.flexexamples.com/2008/01/27/using-a-checkbox-control-as-a-list-item-renderer-in-flex/#comment-7240</link>
		<author>Nathanael Jones</author>
		<pubDate>Fri, 29 Feb 2008 17:48:48 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/01/27/using-a-checkbox-control-as-a-list-item-renderer-in-flex/#comment-7240</guid>
		<description>Finally figured it out. I'll try to post the code on http://nathanaeljones.com/ when I get a chance to fully document it. 

I subclassed List (CheckList) and overrode the mouseDownHandler and mouseUpHandler functions, and changed the event.ctrlKey property when the mouse was over a checkbox (actually, I delegated the decision to the item renderer through mouseEventToItemRenderer(e);  and a custom ICheckListRenderer interface.

I subclassed Checkbox (BlindCheckbox) and overrode clickHandler, leaving it blank (except for the stopImmedatePropogation command when disabled).

I added an event handler for each checkbox in the renderer (listData set function).
To get the parent list from the item renderer you use IDropInListItemRenderer and implement listData.

&lt;pre class="code"&gt;
_parentList.addEventListener(ListEvent.CHANGE, function():void{
   chkSelected.selected = _parentList.isItemSelected(me.Data);
});
chkSelected.selected = _parentList.isItemSelected(me.Data);
&lt;/pre&gt;

Here's how to translate mouse coordinates arbitrarily from any UI element event to local coordinates (Used by the item renderer to determine whether the checkbox was clicked. I give the user a larger click area).

&lt;pre class="code"&gt;
var pt:Point = new Point(e.localX, e.localY);
 pt = DisplayObject(e.target).localToGlobal(pt);
pt = globalToLocal(pt);
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Finally figured it out. I&#8217;ll try to post the code on <a href="http://nathanaeljones.com/" rel="nofollow">http://nathanaeljones.com/</a> when I get a chance to fully document it. </p>
<p>I subclassed List (CheckList) and overrode the mouseDownHandler and mouseUpHandler functions, and changed the event.ctrlKey property when the mouse was over a checkbox (actually, I delegated the decision to the item renderer through mouseEventToItemRenderer(e);  and a custom ICheckListRenderer interface.</p>
<p>I subclassed Checkbox (BlindCheckbox) and overrode clickHandler, leaving it blank (except for the stopImmedatePropogation command when disabled).</p>
<p>I added an event handler for each checkbox in the renderer (listData set function).<br />
To get the parent list from the item renderer you use IDropInListItemRenderer and implement listData.</p>
<pre class="code">
_parentList.addEventListener(ListEvent.CHANGE, function():void{
   chkSelected.selected = _parentList.isItemSelected(me.Data);
});
chkSelected.selected = _parentList.isItemSelected(me.Data);
</pre>
<p>Here&#8217;s how to translate mouse coordinates arbitrarily from any UI element event to local coordinates (Used by the item renderer to determine whether the checkbox was clicked. I give the user a larger click area).</p>
<pre class="code">
var pt:Point = new Point(e.localX, e.localY);
 pt = DisplayObject(e.target).localToGlobal(pt);
pt = globalToLocal(pt);
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nathanael Jones</title>
		<link>http://blog.flexexamples.com/2008/01/27/using-a-checkbox-control-as-a-list-item-renderer-in-flex/#comment-7231</link>
		<author>Nathanael Jones</author>
		<pubDate>Fri, 29 Feb 2008 04:54:46 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/01/27/using-a-checkbox-control-as-a-list-item-renderer-in-flex/#comment-7231</guid>
		<description>I'm trying to figure out how to make a List box multi-select using check-boxes as well as the standard ctrl/shift shortcuts.

I've tried modifying the selectedItems collection and overriding ctrlKey during the capture stage of the mouse events. Neither seem to work right.

Any ideas?</description>
		<content:encoded><![CDATA[<p>I&#8217;m trying to figure out how to make a List box multi-select using check-boxes as well as the standard ctrl/shift shortcuts.</p>
<p>I&#8217;ve tried modifying the selectedItems collection and overriding ctrlKey during the capture stage of the mouse events. Neither seem to work right.</p>
<p>Any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jesse</title>
		<link>http://blog.flexexamples.com/2008/01/27/using-a-checkbox-control-as-a-list-item-renderer-in-flex/#comment-6515</link>
		<author>Jesse</author>
		<pubDate>Wed, 30 Jan 2008 23:21:31 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/01/27/using-a-checkbox-control-as-a-list-item-renderer-in-flex/#comment-6515</guid>
		<description>Hi Keith,

The way I accomplish that is to dispatch a custom DoFilter event each time a checkbox is checked/unchecked.

The DoFilter event triggers 2 things.  First, it updates a list of active filters (unchecked check boxes).  Second, it calls myDataGrid.dataProvider.refresh().

The refresh() call triggers the dataprovider's sort() and filterFunction() functions.

You'll need to define the filterFunction for the dataProvider such that it looks through the list of active filters and returns true/false for each item appropriately.

Jesse</description>
		<content:encoded><![CDATA[<p>Hi Keith,</p>
<p>The way I accomplish that is to dispatch a custom DoFilter event each time a checkbox is checked/unchecked.</p>
<p>The DoFilter event triggers 2 things.  First, it updates a list of active filters (unchecked check boxes).  Second, it calls myDataGrid.dataProvider.refresh().</p>
<p>The refresh() call triggers the dataprovider&#8217;s sort() and filterFunction() functions.</p>
<p>You&#8217;ll need to define the filterFunction for the dataProvider such that it looks through the list of active filters and returns true/false for each item appropriately.</p>
<p>Jesse</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keith</title>
		<link>http://blog.flexexamples.com/2008/01/27/using-a-checkbox-control-as-a-list-item-renderer-in-flex/#comment-6446</link>
		<author>Keith</author>
		<pubDate>Mon, 28 Jan 2008 21:02:01 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/01/27/using-a-checkbox-control-as-a-list-item-renderer-in-flex/#comment-6446</guid>
		<description>I am attempting to build a filter that will add or remove items from a Datagrid. The two fields I would like to filter are categories and locations. I would like to filter the two fields with a checkbox for each field. Here is the example. A user selects a location which filters the categories available at that location, it also filters the Datagrid. The user then selects a category which filters the DataGrid. If the user removes the check mark, the filtered data is removed from the DataGrid. The filter also has the ability to display all items. Is it possible to use your code in the example above?</description>
		<content:encoded><![CDATA[<p>I am attempting to build a filter that will add or remove items from a Datagrid. The two fields I would like to filter are categories and locations. I would like to filter the two fields with a checkbox for each field. Here is the example. A user selects a location which filters the categories available at that location, it also filters the Datagrid. The user then selects a category which filters the DataGrid. If the user removes the check mark, the filtered data is removed from the DataGrid. The filter also has the ability to display all items. Is it possible to use your code in the example above?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
