1. cnickl's Avatar
    I have a hopefully simple to answer problem. I wrote an App using the Storm simulator and my Storm device to test it. I’m pretty happy with how things work, but now I want to know or rather make the App work on non touch screen devices. I loaded it into the Bold simulator that comes with the 5.0 JDE and ran into some problems.

    The App uses 4 field managers dividing the screen into 4 equal parts. Each manager has several buttons. On a touch screen it’s pretty easy to access all the buttons by simply clicking them. My hope was that using the touch pad (or track ball) on non touch devices the focus would shift automatically from button to button, but it don’t. I haven’t done too much research on the subject (actually non), but the first thing that came to my mind was to override the navigationMovement() method in the screen class. Responding to the direction of movement and setting or changing the focus on the buttons accordingly. Is this really the only way to do this? Is there a setting (Field property or equal) in the screen class that leads to this behavior by default? I don’t want to reinvent the wheel when there is already functionality there.
    02-09-10 09:58 AM
  2. mikeo007's Avatar
    I know that the new Widget SDK that RIM released last week includes several ways to handle navigation.

    By default, the device will navigate to the next logical element (ie scroll down, you get the next selectable element below the current one.)

    You can also invoke the onscrollup, down, etc. for each element and define which element you want to select on each action.

    Now this is all for Widgets, so it's done with Javascript/CSS/HTML, but I would imagine there is a similar functionality in the java SDK.

    If you write a really simple application with say: 1 field manager and 2 buttons, does the scrolling work automatically? I've never tried, but it might be best to investigate with something simpler first, since you do run into complications once you use multiple managers.
    02-09-10 03:52 PM
  3. GlenB's Avatar
    You are both right, the java development environment works in the same way, the order the focusable fields are added to the layour managers determines the navigation order and the only way (at least pre v5.0 device code, I havent yet played with v5.0) to change this is to override the navigation movement method on the screen object. It may be worth looking at examples, such as the gridfieldmanager to see how they have dealt with such issues.
    02-10-10 11:57 PM
LINK TO POST COPIED TO CLIPBOARD