BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 09-21-2007, 09:30 AM   #1 (permalink)
New Member
 
Join Date: Sep 2007
Model: 7100
PIN: N/A
Carrier: GT
Posts: 9
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Radio button trackwheelclick problem. (solution found)

Please Login to Remove!

Hi,

I'm newbie blackberry and java.
I designed a screen and tree radio button on it. When I click one of them with trackwheel a menu appears topright of the screen and "Change Option" appears.

However the space button works well.

I dont want to show menu when I click the trackwheel. I want it works like space button.

Please help. Thanks.
Attached Images
File Type: jpg bberry.JPG (6.1 KB, 7 views)

Last edited by ParacelciuS : 09-24-2007 at 08:44 AM.
Offline  
Old 09-21-2007, 10:20 AM   #2 (permalink)
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

implement TrackwheelListener. The only function you need is trackwheelClick:

Code:
public boolean trackwheelClick(int status,int time) {
Field focus = getLeafFieldWithFocus();
now you can check on certain fields, like

Code:
if (focus=myButton) {
         doSomething();
         true;
         }
else if (focus=myOtherButton){
         doSomethingElse();
         return true;
         }
return false;
if you return true the click-event was consumed, if you return false you will get the standard menu. If you want your own menu you can just replace the 'return false' with your menu and return true.

hth,
simon
__________________
java developer, Devinto, hamburg/germany
Offline  
Old 09-21-2007, 01:06 PM   #3 (permalink)
New Member
 
Join Date: Sep 2007
Model: 7100
PIN: N/A
Carrier: GT
Posts: 9
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you very much Simon,

but..

I try this method before but it dosn't work. The standart menu not appears, however the radio button isn't selected. (only blinking) Any idea?

best regards.
Offline  
Old 09-24-2007, 08:39 AM   #4 (permalink)
New Member
 
Join Date: Sep 2007
Model: 7100
PIN: N/A
Carrier: GT
Posts: 9
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Finally I found solution
Code:
public boolean trackwheelClick(int status, int time) {
   Field focus = UiApplication.getUiApplication().getActiveScreen().getLeafFieldWithFocus();
        if (focus instanceof RadioButtonField){
            RadioButtonField rb = (RadioButtonField)getLeafFieldWithFocus();
            rb.setSelected(true);
            return true;
        } else {
          return true;
        }
      }
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

1pc Schneider PC-E984-245 CPU PCE984245
$516.06
1pc Schneider PC-E984-245 CPU PCE984245 picture1pc GE Fanuc IC693CPU311K
$159.45
1pc GE Fanuc IC693CPU311K picture1pc KEYENCE CPU KZ-A500
$125.47
1pc KEYENCE CPU KZ-A500 picture1pc Desktop Computer CPU Network Adapter Wired Gigabit EG1032
$679.42
1pc Desktop Computer CPU Network Adapter Wired Gigabit EG1032 picture2016 FACTORY SEALED Allen Bradley 1756-L85E Series B Processor ControlLogix 40MB
$10995.0
2016 FACTORY SEALED Allen Bradley 1756-L85E Series B Processor ControlLogix 40MB picture






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