You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@royale.apache.org by Maria Jose Esteve <mj...@iest.com> on 2019/12/26 10:54:38 UTC

Event, target null, currentTarget undefined

Hi, see if anyone can help me ...

I have a MyEvent event that I launch from a MyView view (MVC):

public function SecurityEvent(type:String)
{
super(type, true, true);
            //_targetViewPopup = target;
}


var mEvent:MyEvent = new MyEvent (MyEvent.ON_CHANGE);
dispatchEvent(mEvent);

I need to save the reference to the view that generated the event, the target, but I don't get it: target is null and currentTarget is undefined.
I have debugged and I do not see any property or variable that contains this data.
Where can I get it? Any method?

I would appreciate any help.
Thank you all.

Hiedra.


RE: Event, target null, currentTarget undefined

Posted by Maria Jose Esteve <mj...@iest.com>.
Ok, it makes sense, I try to capture it in the controller and I tell you

Thank Harbs

De: Harbs [via Apache Royale Users] <ml...@n8.nabble.com>
Enviado el: jueves, 26 de diciembre de 2019 14:12
Para: Maria Jose Esteve <mj...@iest.com>
Asunto: Re: Event, target null, currentTarget undefined

The event target is set when the event is dispatched.

You can’t save the target in the constructor because it does not exist yet.

If you are not getting the target in an event handler, please provide some more code to show the issue.

HTH,
Harbs


On Dec 26, 2019, at 12:57 PM, Maria Jose Esteve <[hidden email]</user/SendEmail.jtp?type=node&node=3151&i=0>> wrote:

Sorry, there was an error ... (when renaming for the example)


public function MyEvent(type:String)
{
super(type, true, true);
            //_targetViewPopup = target;
}

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

Hi, see if anyone can help me ...

I have a MyEvent event that I launch from a MyView view (MVC):

public function SecurityEvent(type:String)
{
super(type, true, true);
            //_targetViewPopup = target;
}


var mEvent:MyEvent = new MyEvent (MyEvent.ON_CHANGE);
dispatchEvent(mEvent);

I need to save the reference to the view that generated the event, the target, but I don't get it: target is null and currentTarget is undefined.
I have debugged and I do not see any property or variable that contains this data.
Where can I get it? Any method?

I would appreciate any help.
Thank you all.

Hiedra.



________________________________
If you reply to this email, your message will be added to the discussion below:
http://apache-royale-users.20374.n8.nabble.com/Event-target-null-currentTarget-undefined-tp3149p3151.html
To start a new topic under Apache Royale Users, email ml+s20374n1h13@n8.nabble.com<ma...@n8.nabble.com>
To unsubscribe from Apache Royale Users, click here<http://apache-royale-users.20374.n8.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1&code=bWplc3RldmVAaWVzdC5jb218MXwtMTMzODcyOQ==>.
NAML<http://apache-royale-users.20374.n8.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>

Re: Event, target null, currentTarget undefined

Posted by Harbs <ha...@gmail.com>.
The event target is set when the event is dispatched.

You can’t save the target in the constructor because it does not exist yet.

If you are not getting the target in an event handler, please provide some more code to show the issue.

HTH,
Harbs

> On Dec 26, 2019, at 12:57 PM, Maria Jose Esteve <mj...@iest.com> wrote:
> 
> Sorry, there was an error ... (when renaming for the example)
>  
>  
> public function MyEvent(type:String)
> {
> super(type, true, true);
>             //_targetViewPopup = target;
> }
>  
> ----------------------------------------------------------------
>  
> Hi, see if anyone can help me ...
>  
> I have a MyEvent event that I launch from a MyView view (MVC):
>  
> public function SecurityEvent(type:String)
> {
> super(type, true, true);
>             //_targetViewPopup = target;
> }
>  
>  
> var mEvent:MyEvent = new MyEvent (MyEvent.ON_CHANGE);
> dispatchEvent(mEvent);
>  
> I need to save the reference to the view that generated the event, the target, but I don't get it: target is null and currentTarget is undefined.
> I have debugged and I do not see any property or variable that contains this data.
> Where can I get it? Any method?
>  
> I would appreciate any help.
> Thank you all.
>  
> Hiedra.
>  


RV: Event, target null, currentTarget undefined

Posted by Maria Jose Esteve <mj...@iest.com>.
Sorry, there was an error ... (when renaming for the example)


public function MyEvent(type:String)
{
super(type, true, true);
            //_targetViewPopup = target;
}

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

Hi, see if anyone can help me ...

I have a MyEvent event that I launch from a MyView view (MVC):

public function SecurityEvent(type:String)
{
super(type, true, true);
            //_targetViewPopup = target;
}


var mEvent:MyEvent = new MyEvent (MyEvent.ON_CHANGE);
dispatchEvent(mEvent);

I need to save the reference to the view that generated the event, the target, but I don't get it: target is null and currentTarget is undefined.
I have debugged and I do not see any property or variable that contains this data.
Where can I get it? Any method?

I would appreciate any help.
Thank you all.

Hiedra.