Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

New Developer
Posts: 28
Registered: ‎07-21-2008
My Device: Not Specified
Accepted Solution

Differences between navigationClick and the TrackWheelListener

Actually i have a few questions here. 


What are the differences between navigationClick and the TrackWheelListener?  When should i use which one.  I am trying to follow the MVC model.  


Is there any good example of a code that follows MVC model?   

Posts: 179
Registered: ‎07-14-2008
My Device: Not Specified

Re: Differences between navigationClick and the TrackWheelListener

The TrackwheelListener really should only be used when leveraging a Trackwheel device and performing your own custom handling of the trackwheel movements on the device.  Due to the transition between trackwheel devices (eg. 8700) and trackball devices (eg. 8100 and up) we have mapped the trackball events to the TrackwheelListener in an attempt to provide backwards compatibility.  However, this brings up the following limitations:


1) Left and right movement does not exist in a TrackwheelListener but is possible using the Trackball.  As such, users have a suboptimal user experience on a Trackball device.  Many vendors would allow the user to hold down ALT and roll the trackball up and down to indicate left/right movement as a work around.  But again, this isn't the best user experience.


2) TrackwheelListener is an independent mechanism from the UI classes.  As such, once you receive notification of a movement or click you are then required to determine which field within your UI needs to operate on that movement or click.  This requires extra processing and code to determine how to handle the event.


As such, the recommendation is that you would override the navigationClick, navigationMovement and navigationUnclick methods to handle all trackball movement and trackwheel movement.  This will handle both trackwheel and trackball devices properly which solves #1.  It is also built into the UI classes themselves which reduces the impact of #2 above.


The only downside to using these methods is that it requires your application to be built with the 4.2.0 JDE and requires a minimum of 4.2.0 handheld software.  For the large majority of third party developers, v4.2.0 is a sufficient minimum requirement given the proportion of the market that is running 4.2.0 or higher (over 75%).


Mike Kirkup
Director, Developer Relations