a button but I must be missing something. Here is a simple example of
what I'm talking about. If any row is selected in dg, then all
buttons except button "A" should be disabled. What do I need to do to
make this happen?
Thanks, Bill...
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*"
layout="vertical">
<mx:Script>
<![CDATA[
import mx.events.ItemClickEvent;
import mx.events.ListEvent;
private function btnbarEvent(event:ItemClickEvent):void{
ta.text="btnbar selected index is "+event.index.toString();
}
private function dgEvent(event:ListEvent):void{
ta.text="dg selected index is "+event.rowIndex.toString();
}
]]>
</mx:Script>
<mx:DataGrid id="dg" itemClick="dgEvent(event)">
<mx:dataProvider>
<mx:ArrayCollection>
<mx:source>
<mx:Object item="Something" descr="Some thing"/>
<mx:Object item="Nothing" descr="No thing"/>
</mx:source>
</mx:ArrayCollection>
</mx:dataProvider>
</mx:DataGrid>
<mx:ButtonBar id="btnbar" itemClick="btnbarEvent(event)">
<mx:dataProvider>
<mx:Array>
<mx:String>A</mx:String>
<mx:String>B</mx:String>
<mx:String>C</mx:String>
<mx:String>D</mx:String>
</mx:Array>
</mx:dataProvider>
</mx:ButtonBar>
<mx:TextArea id="ta" width="200" height="100"/>
</mx:Application>
--- In flexcoders@yahoogroups.com, "Michael Schmalle"
<[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> Did you cast the returned button instance to Button?
>
> var child:Button = getChildAt(buttonIndex) as Button;
>
> Peace, Mike
>
> On 4/20/06, wlbagent <[EMAIL PROTECTED]> wrote:
> >
> > I know this can be done using individual buttons but can the
> > individual buttons in a ButtonBar component (not the whole ButtonBar)
> > be enabled or disabled?
> >
> > For example. You have a ButtonBar with 4 buttons labeled
> > "A","B","C",and "D". You want button "A" to always be enabled but the
> > remaining buttons would be enabled or disabled based on some other
> > condition. You might have a DataGrid and want "B","C",and "D" enabled
> > if a row is selected, otherwise they are disabled.
> >
> > This should be a fairly easy thing to do if its actually possible. I
> > can reference the individual buttons but there doesn't seem to be an
> > enabled property for them. What have I missed??
> >
> > Any ideas???
> >
> >
> >
> >
> >
> > --
> > Flexcoders Mailing List
> > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com
> >
> >
> >
> > SPONSORED LINKS
> > Web site design
development<http://groups.yahoo.com/gads?t=ms&k=Web+site+design+development&w1=Web+site+design+development&w2=Computer+software+development&w3=Software+design+and+development&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=166&.sig=L-4QTvxB_quFDtMyhrQaHQ>
Computer
> > software
development<http://groups.yahoo.com/gads?t=ms&k=Computer+software+development&w1=Web+site+design+development&w2=Computer+software+development&w3=Software+design+and+development&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=166&.sig=lvQjSRfQDfWudJSe1lLjHw>
Software
> > design and
development<http://groups.yahoo.com/gads?t=ms&k=Software+design+and+development&w1=Web+site+design+development&w2=Computer+software+development&w3=Software+design+and+development&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=166&.sig=1pMBCdo3DsJbuU9AEmO1oQ>
Macromedia
> >
flex<http://groups.yahoo.com/gads?t=ms&k=Macromedia+flex&w1=Web+site+design+development&w2=Computer+software+development&w3=Software+design+and+development&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=166&.sig=OO6nPIrz7_EpZI36cYzBjw>
Software
> > development best
practice<http://groups.yahoo.com/gads?t=ms&k=Software+development+best+practice&w1=Web+site+design+development&w2=Computer+software+development&w3=Software+design+and+development&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=166&.sig=f89quyyulIDsnABLD6IXIw>
> > ------------------------------
> > YAHOO! GROUPS LINKS
> >
> >
> > - Visit your group
"flexcoders<http://groups.yahoo.com/group/flexcoders>"
> > on the web.
> >
> > - To unsubscribe from this group, send an email to:
> >
[EMAIL PROTECTED]<[EMAIL PROTECTED]>
> >
> > - Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> > Service <http://docs.yahoo.com/info/terms/>.
> >
> >
> > ------------------------------
> >
>
>
>
> --
> What goes up, does come down.
>
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
Web site design development | Computer software development | Software design and development |
Macromedia flex | Software development best practice |
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.