BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 07-17-2010, 07:47 PM   #1 (permalink)
New Member
 
Join Date: Jul 2010
Model: 9630
PIN: N/A
Carrier: Verizon
Posts: 11
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default event propagation

Please Login to Remove!

Hi. What is the proper way to propagate an event to calling objects ? For example, I have a sub-classed button that's in a manager. On button click, I want to process the navClick event in the button itself and also raise it up to the manager to do some work there based on the click trigger.

I figured out that I can do it by either passing the manager reference to the button and invoking a manager method from the button. Or creating an interface that the manager would implement and calling it from the button event handler.

Is there a better way to do this ?

Thanks.
Offline  
Old 07-17-2010, 09:27 PM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default

navigationClick returns true if the consumed the event, false otherwise. You could return false which would indicate to the system that it should find another target for the event. This may not be the object you want. Better? Perhaps, if it does what you want.
__________________
My other Blackberry is a PlayBook.
Offline  
Old 07-17-2010, 11:50 PM   #3 (permalink)
New Member
 
Join Date: Jul 2010
Model: 9630
PIN: N/A
Carrier: Verizon
Posts: 11
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you for the idea. It almost worked. The event bubles up to the manager. The problem is that now the manager navClick does the same thing as the button navClick, which I do not want. In other words, if I click anywhere in the manager, it does the same thing as if I clicked on the button inside the manager. I am not sure if it's possible to trace the originating control of the event. navClick has only status and time params.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.