Thank you so much. Would work beautifully. But I am using the checkCell more as item renderer inside a datagrid. On selecting one checkbox dummyCheckBox_cb I want to select all the check boxes inside my datagrid column. thanks

 

 


Sent: Wednesday, June 14, 2006 12:20 PM
To: [email protected]
Subject: [flexcoders] Re: calling custom component methods inside the parent application

 

This should work as long as you define an id in the main application
mxml, for your CheckCell.mxml component.

<yourNamespace:CheckCell id="checkCell" click="checkCell.dummy()"/>

In the CheckCell.mxml:

cbSelected = Application.application.dummyCheckBox_cb.selected;

//----------------------------------------------------------

However, you could do it this way.

Define your component in the main application xmxl like this:

<yourNamespace:CheckCell id="checkCell" cbSelected=
{dummyCheckBox_cb.selected}/>

In the CheckCell.mxml:

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

<mx:Script>
<![CDATA[

[Bindable]
public var cbSelected:Boolean;

]]>
</mx:Script>

<mx:CheckBox id="followUpCB" selected="{cbSelected}"/>

</mx:VBox>

//----------------------------------------------------------

Regards,
-TH

--- In [EMAIL PROTECTED]ups.com, "Chaitu Vadlapatla"
<chaitu.vadlapatla@...> wrote:
>
> <mx:CheckBox id="dummyCheckBox_cb" click="CheckCell.dummy()"
x="15" y="535"/>//this piece is in my main application mxml
>
> My problem is with the click function. On this click of the check
box I want to call a function inside my component mxml and I cannot.
The component MXML looks like this
>
> Component MXML named ="CheckCell.MXML
>
> <?xml version="1.0" encoding="utf-8"?>
>
>
>
> <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml">
>
> <mx:Script>
>
> <![CDATA[
>
> // Define a property for returning
>
> // the new value to the cell.
>
> public var cbSelected:Boolean;
>
> public function dummy ()
>
> {
>
> cbSelected =
parentApplication.dummyCheckBox_cb.selected;
>
> }
>
> ]]>
>
> </mx:Script>
>
> <mx:CheckBox id="followUpCB"
selected="{cbSelected}" creationCompleteEffect=" dummy ()" />
>
> </mx:VBox>
>
> Thanks
>
> Chaitu.
>
>
>
>
>
> ________________________________
>
> From: [EMAIL PROTECTED]ups.com
[mailto:[EMAIL PROTECTED]ups.com] On Behalf Of Luís Gustavo Sanabio
> Sent: Wednesday, June 14, 2006 6:37 AM
> To: [EMAIL PROTECTED]ups.com
> Subject: Re: [flexcoders] calling custom component methods inside
the parent application
>
>
>
> What is raga?
>
> Maybe ID is missing.
>
> <mx:CheckBox id="raga" click="CheckCell.dummy()" x="15" y="535"/>
>
> Gustavo Sanabio
>
>
>
> 2006/6/13, Jeremy Lu <[EMAIL PROTECTED]>:
>
>
>
> try this:
>
> public function dummy ()
>
> {
>
>
>
> cbSelected = parent.raga.selected;
>
>
> //or
>
> cbSelected =
Application.application .raga.selected;
>
>
>
> }
>
> ]]>
>

__._,_.___

--
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




__,_._,___

Reply via email to