Hi Tracey,
Many thanks for your responses so far.
My only question is how do you bind any data into the popup?
Some example code...
In the parent AS code:
// declare new instance of my popup item
Var addPopUP:MyPopUp = new MyPopUp();
// assign var value to popup
AddPopUp.someData = _someData;
// display popup
PopUpManager.addPopUP( addPopUp, this, true);
In the Popup:
[Bindable]
Private var _someData:String;
[Bindable]
Public function set someData (value:String):void
{
_someData = value;
}
Public function get someData():String
{
return _someData;
}
So, with your code inserted, how would the code above look different so that
when the _someData var in the parent changed, popup would automatically see
that change? (without creating another function in the parent it needs to
be binded).
Thanks!
Dave.
From: Tracy Spratt <[email protected]>
Reply-To: <[email protected]>
Date: Fri, 7 Aug 2009 22:49:00 -0400
To: <[email protected]>
Subject: RE: [flexcoders] Re: PopUp databinding - possible?
³in the creationComplete="init() of the PopUp?² Yes.
Full syntax of what? This: ³[Bindable]private var _app:MyMainAppFileName;²
is full syntax.
Tracy Spratt,
Lariat Services, development services available
From: [email protected] [mailto:[email protected]] On
Behalf Of [email protected]
Sent: Friday, August 07, 2009 2:25 PM
To: [email protected]
Subject: [flexcoders] Re: PopUp databinding - possible?
Tracy:
What do you mean by?
In a creation complete handler, assign:
_var =Application.application as MyMainAppFileName;
Do you mean in the creationComplete="init() of the PopUp? If so, what is the
full syntax?
Thanks!
Lee
--- In [email protected] <mailto:flexcoders%40yahoogroups.com> ,
"Tracy Spratt" <tr...@...> wrote:
>
> Sure. In the pop-up, define a bindable variable, say
>
> [Bindable]private var _app:MyMainAppFileName;
>
>
>
> In a creation complete handler, assign:
>
> _var = Application.application as MyMainAppFileName;
>
>
>
> Now you can bind to any bindable property in MyMainAppFileName
>
>
>
> If that is backwards to what you want, then I advise dispatching events from
> the Pop-up. Remember, binding is just an event mechanism that is created by
> the compiler.
>
>
>
>
>
> Tracy Spratt,
>
> Lariat Services, development services available
>
> _____
>
> From: [email protected] <mailto:flexcoders%40yahoogroups.com>
[mailto:[email protected] <mailto:flexcoders%40yahoogroups.com> ] On
> Behalf Of Dave Cates
> Sent: Friday, August 07, 2009 10:01 AM
> To: [email protected] <mailto:flexcoders%40yahoogroups.com>
> Subject: [flexcoders] PopUp databinding - possible?
>
>
>
>
>
> Hi all,
>
> I have an mxml component that I am displaying via the popup manager method.
>
> But, I have data that is sent to this popup that needs to be data bound -
> database updates etc.
>
> So, how do you databind to the vars inside the popup? If the MXML component
> was on the stage as normal I'd have no problems but the popup, my nature, is
> created at run-time.
>
> So is it possible and if so, how?!
>
> Thanks!
> Dave.
>
>