BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 07-17-2010, 06:47 PM   #1
vladt
New Member
 
Join Date: Jul 2010
Model: 9630
PIN: N/A
Carrier: Verizon
Posts: 11
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, 08:27 PM   #2
hrbuckley
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
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, 10:50 PM   #3
vladt
New Member
 
Join Date: Jul 2010
Model: 9630
PIN: N/A
Carrier: Verizon
Posts: 11
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



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Vintage Apple Computer 4” Paper Cube Notepad Macintosh 80s 90s Office White picture

Vintage Apple Computer 4” Paper Cube Notepad Macintosh 80s 90s Office White

$39.95



6502 CPU - Over 100 chips on a vintage 4 inch Silicon wafer picture

6502 CPU - Over 100 chips on a vintage 4 inch Silicon wafer

$275.00



Vintage Post-it Note Pad Apple Magnetic Holder Pince A Notes Unused 1988 NOS picture

Vintage Post-it Note Pad Apple Magnetic Holder Pince A Notes Unused 1988 NOS

$16.99



Apple 1 Replica IC's: Vintage IC’s Many Types See List NOS 74XXX Types - Apple I picture

Apple 1 Replica IC's: Vintage IC’s Many Types See List NOS 74XXX Types - Apple I

$20.00



Lot of 6 Vintage Apple Drawstring Bags For iPhone, Mac, Apple Watch, iPod picture

Lot of 6 Vintage Apple Drawstring Bags For iPhone, Mac, Apple Watch, iPod

$45.00



Retro 1951 Apple Computer Logo 0.7mm Ballpoint Black Ink Pen Gold Barrel picture

Retro 1951 Apple Computer Logo 0.7mm Ballpoint Black Ink Pen Gold Barrel

$56.41







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