[flex_india:26386] How to disable radio button?

View: New views
5 Messages — Rating Filter:   Alert me  

[flex_india:26386] How to disable radio button?

by mahesh bab :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.


Hi

I have radio button and have written click event.

Here i have disabled radio button(radibuttonid.enabled=false).It is in disable mode only.

But wen i click on radio button the click event will be fired.How to remove that one?




Regards

D.Mahesh babu

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex India Community" group.
To post to this group, send email to flex_india@...
To unsubscribe from this group, send email to flex_india+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---


[flex_india:26418] Re: How to disable radio button?

by Viv :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Even it is disabled - the radio button listens the click event!!!!
See the following example.


------------------------------------------------------------------------------------------------------------------------------------


<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    public function disabledClick(event:Event):void
    {
    mx.controls.Alert.show("disabled radio btn clicked");
    //uncomment the following line if you want to enable it
    //event.target.enabled=true;
    }
    ]]>
    </mx:Script>

        <mx:RadioButton id="btn" label="RButton" enabled="false"
click="disabledClick(event)" x="200" y="200"
                fontWeight="bold" fontSize="14"/>
       
</mx:Application>


------------------------------------------------------------------------------------------------------------------------------------


On Wed, Nov 4, 2009 at 7:34 AM, mahesh bab <mahesh.dudwala@...> wrote:

>
>
> Hi
>
> I have radio button and have written click event.
>
> Here i have disabled radio button(radibuttonid.enabled=false).It is in
> disable mode only.
>
> But wen i click on radio button the click event will be fired.How to remove
> that one?
>
>
> Regards
>
> D.Mahesh babu
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex India Community" group.
To post to this group, send email to flex_india@...
To unsubscribe from this group, send email to flex_india+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---


[flex_india:26419] Re: How to disable radio button?

by Andrea Giorgetta :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

When disabling the radiobutton, you should also remove the event listener using:
 
    radibuttonid.removeEventListener(MouseEvent.CLICK,nameOfFunctionThatHandlesClickEvent);
 
In order to remove the event listener, it must have been added programatically (instead of using MXML syntax click="nameOfFunctionThatHandlesClickEvent()"), so on creationComplete event (or some other initialization event) you should do:
 
    radiobuttonid.addEventListener(MouseEvent.CLICK,nameOfFunctionThatHandlesClickEvent);
 
Then, you can add it again when re-enabling the radiobutton.
 
 
 
Best Regards
Andrea
 
 

 
On Wed, Nov 4, 2009 at 12:34 PM, mahesh bab <mahesh.dudwala@...> wrote:


Hi

I have radio button and have written click event.

Here i have disabled radio button(radibuttonid.enabled=false).It is in disable mode only.

But wen i click on radio button the click event will be fired.How to remove that one?




Regards

D.Mahesh babu
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex India Community" group.
To post to this group, send email to flex_india@...
To unsubscribe from this group, send email to flex_india+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---


[flex_india:26395] Re: How to disable radio button?

by Kaleem-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


add an EventListener to your radiobutton, and remove the listener when
its getting disabled.
like

radioBtn.removeListener();

also remove the include in tab property as if tab is enabled and focus
comes to radio button it can be made selected from space bar.

Hope this will help.


-Kaleem

On Nov 4, 8:34 pm, mahesh bab <mahesh.dudw...@...> wrote:

> Hi
>
> I have radio button and have written click event.
>
> Here i have disabled radio button(radibuttonid.enabled=false).It is in
> disable mode only.
>
> But wen i click on radio button the click event will be fired.How to remove
> that one?
>
> Regards
> D.Mahesh babu
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex India Community" group.
To post to this group, send email to flex_india@...
To unsubscribe from this group, send email to flex_india+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---


[flex_india:26412] Re: How to disable radio button?

by karthi keyan-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I hope below one will help for you.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"  >
<mx:Script>
        <![CDATA[
        import mx.controls.Alert;
        private function callFn(evt:MouseEvent):void{
                Alert.show('Hai', 'RadioButton');
                evt.currentTarget.mouseEnabled = false;
        }
               
               
        ]]>
</mx:Script>
<mx:RadioButton label="Submit" click="callFn(event);" />
</mx:Application>




On 11/5/09, Kaleem <caleem@...> wrote:

>
> add an EventListener to your radiobutton, and remove the listener when
> its getting disabled.
> like
>
> radioBtn.removeListener();
>
> also remove the include in tab property as if tab is enabled and focus
> comes to radio button it can be made selected from space bar.
>
> Hope this will help.
>
>
> -Kaleem
>
> On Nov 4, 8:34 pm, mahesh bab <mahesh.dudw...@...> wrote:
>> Hi
>>
>> I have radio button and have written click event.
>>
>> Here i have disabled radio button(radibuttonid.enabled=false).It is in
>> disable mode only.
>>
>> But wen i click on radio button the click event will be fired.How to
>> remove
>> that one?
>>
>> Regards
>> D.Mahesh babu
> >
>


--
Regards
J.R.Karthikeyan.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex India Community" group.
To post to this group, send email to flex_india@...
To unsubscribe from this group, send email to flex_india+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---