<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Toggling buttons in a ToggleButtonBar control in Flex</title>
	<atom:link href="http://blog.flexexamples.com/2009/01/21/toggling-buttons-in-a-togglebuttonbar-control-in-flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com/2009/01/21/toggling-buttons-in-a-togglebuttonbar-control-in-flex/</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Sun, 12 Feb 2012 19:26:49 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Max</title>
		<link>http://blog.flexexamples.com/2009/01/21/toggling-buttons-in-a-togglebuttonbar-control-in-flex/comment-page-1/#comment-7099</link>
		<dc:creator>Max</dc:creator>
		<pubDate>Wed, 24 Feb 2010 16:07:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2009/01/21/toggling-buttons-in-a-togglebuttonbar-control-in-flex/#comment-7099</guid>
		<description>It seems to be a bug, when you set your ToggleButtonBar&#039;s selectedIndex to -1 within the ToggleButtonBar tag it will register as 0 when you run the app. I found a fix: 

When you initialize your app, run a method with the following actionScript: 

this.toggleButtonBar.selectedIndex = -1;

That will deselect the button. You can take it one step further and hide your viewStack by making it visible ONLY when this.toggleButtonBar.selectedIndex != -1 by adding it to the viewStack tag:

mx:ViewStack id=&quot;viewStack&quot; visible=&quot;{this.toggleButton.selectedIndex != -1}&quot;

Hope that helps.</description>
		<content:encoded><![CDATA[<p>It seems to be a bug, when you set your ToggleButtonBar&#8217;s selectedIndex to -1 within the ToggleButtonBar tag it will register as 0 when you run the app. I found a fix: </p>
<p>When you initialize your app, run a method with the following actionScript: </p>
<p>this.toggleButtonBar.selectedIndex = -1;</p>
<p>That will deselect the button. You can take it one step further and hide your viewStack by making it visible ONLY when this.toggleButtonBar.selectedIndex != -1 by adding it to the viewStack tag:</p>
<p>mx:ViewStack id=&#8221;viewStack&#8221; visible=&#8221;{this.toggleButton.selectedIndex != -1}&#8221;</p>
<p>Hope that helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mourya</title>
		<link>http://blog.flexexamples.com/2009/01/21/toggling-buttons-in-a-togglebuttonbar-control-in-flex/comment-page-1/#comment-6670</link>
		<dc:creator>mourya</dc:creator>
		<pubDate>Thu, 24 Dec 2009 14:57:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2009/01/21/toggling-buttons-in-a-togglebuttonbar-control-in-flex/#comment-6670</guid>
		<description>even when i use selectedIndex=&quot;-1&quot;, the first element is selected</description>
		<content:encoded><![CDATA[<p>even when i use selectedIndex=&#8221;-1&#8243;, the first element is selected</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter deHaan</title>
		<link>http://blog.flexexamples.com/2009/01/21/toggling-buttons-in-a-togglebuttonbar-control-in-flex/comment-page-1/#comment-4097</link>
		<dc:creator>Peter deHaan</dc:creator>
		<pubDate>Sat, 31 Jan 2009 01:53:16 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2009/01/21/toggling-buttons-in-a-togglebuttonbar-control-in-flex/#comment-4097</guid>
		<description>Wow, I really should go back and add SWFs to these older posts.

Eric,
When the toggleOnClick CheckBox is deselected, clicking an already selected button has no effect and the &lt;code&gt;selectedIndex&lt;/code&gt; doesn&#039;t change. When the toggleOnClick CheckBox is selected, clicking an already selected button sets the &lt;code&gt;selectedIndex&lt;/code&gt; property to -1.

I&#039;ll try and get that SWF up right now...

Peter</description>
		<content:encoded><![CDATA[<p>Wow, I really should go back and add SWFs to these older posts.</p>
<p>Eric,<br />
When the toggleOnClick CheckBox is deselected, clicking an already selected button has no effect and the <code>selectedIndex</code> doesn&#8217;t change. When the toggleOnClick CheckBox is selected, clicking an already selected button sets the <code>selectedIndex</code> property to -1.</p>
<p>I&#8217;ll try and get that SWF up right now&#8230;</p>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Belair</title>
		<link>http://blog.flexexamples.com/2009/01/21/toggling-buttons-in-a-togglebuttonbar-control-in-flex/comment-page-1/#comment-4098</link>
		<dc:creator>Eric Belair</dc:creator>
		<pubDate>Fri, 30 Jan 2009 14:16:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2009/01/21/toggling-buttons-in-a-togglebuttonbar-control-in-flex/#comment-4098</guid>
		<description>I&#039;m not sure that I see any difference between when the checkBox is selected or not. What should I be seeing?</description>
		<content:encoded><![CDATA[<p>I&#8217;m not sure that I see any difference between when the checkBox is selected or not. What should I be seeing?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

