• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

why to send generated Event Object to the EventListener ??

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Please let me know what is the need for sending EventObject to the event Handler ?

For example if we select an Item inside a Combobox an ItemEvent will be generated , and we generally pass this event
to the Event Listener .

<mx:combobox id="combo" change = "calllistener(event)"/>



Please share your ideas .

 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How does your event handler know anything about the event (other than its type) otherwise?
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks , when i read about result , target and currentTarget i could know Events Object usage .

 
Hongli Li
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when you want to carry additional information,you will carry those data with an eventoject, usually a customized eventObject, this is a great way of decoupling your application.
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Hongli for the additional information .

usually a customized eventObject

But can you please tell me how will you suppourt this and how this will work ??

Thanks in advance.

 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You:
  • Write a custom event class
  • Write code that can trigger this event
  • Write and register an event handler for the event

  •  
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic