BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 11-09-2010, 06:01 AM   #1 (permalink)
New Member
 
Join Date: Nov 2010
Model: 8320
PIN: N/A
Carrier: T-Mobile
Posts: 1
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Dialog shortcut problem

Please Login to Remove!

The needs

From a list of phone numbers,
I want to make a dialog list to display 2 choices like below
==================
Which phone number?
1. Mobile: 098989897828
2. Home: +812345676789

==================

2 items are formated with prefix numbers corresponding to shorcut 1 and 2.

When user press key alt + w (number 1), item 1 is selected.
When user press key alt + e (number 2), item 2 is selected.

But I want when user press only w key, item 1 is selected too.
It means that he don't need to press both alt + w
Similarly, if he press e or alt + e, item 2 is selected.

The problem

I have make an extend of Dialog, overwrite keyChar() function,
replace char with equivalent key, etc, but it does not success when inputting w or e
But if I press key 1 (alt + w) or 2 (alt + e), it is OK.

Please see my code below and help me a solution.
Thanks in advance

Please notice that I make 2 cases with different calls but it still not success any more.

==========================
Extend dialog with overwrite keyChar()
==========================

PHP Code:
public class PhoneChoiceDialog extends Dialog {
    
    protected 
int countPhoneNumber;
    
    
    public 
PhoneChoiceDialog(String messageObjectxxx91;xxx93; choicesintxxx91;xxx93; values,
            
int defaultChoiceBitmap bitmap,long style) {
        
super(messagechoicesvaluesdefaultChoicebitmapstyle);
        
// TODO Auto-generated constructor stub
    
}


    protected 
boolean keyCharchar cint statusint time ) {

            switch( 
) {                
                case 
'1':
                case 
'2':
                    return 
super.keyChar(cstatustime);
                    
                case 
'w':
                    
//Replace 'w' with '1'
                    
return super.keyChar('1'statustime);
                                    
                case 
'e':
                    
//Replace 'e' with '2'
                    
super.keyChar('2'statustime);
                    return 
true;
                                    
          
            }
        return 
true;
        
    }

==========================
extend dialog is called from here
==========================

PHP Code:
PhoneChoiceDialog choiceNumberDialog = new PhoneChoiceDialog("Which number?",contactInfo.phoneListWithChoiceNumber,null,1,Bitmap.getPredefinedBitmap(Bitmap.QUESTION),Dialog.LIST);
                                
                                
choiceNumberDialog.countPhoneNumber contactInfo.phoneListCount;
                                
                                
int choiceNumber choiceNumberDialog.doModal(); 
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

(2 pack) Dataproducts R5110 IBM 1299845 Compatible Typewriter Ribbon Sealed OEM
$8.99
(2 pack) Dataproducts R5110 IBM 1299845 Compatible Typewriter Ribbon Sealed OEM pictureIBM 1337765 Lift-Off CorrectionTape - Genuine OEM for IBM Wheelwriter
$9.99
IBM 1337765 Lift-Off CorrectionTape - Genuine OEM for IBM Wheelwriter  pictureIBM OEM DPES-31080 DPES31080 Drive Disk 1080MB
$160.3
IBM OEM DPES-31080 DPES31080 Drive Disk 1080MB pictureIBM Lenovo THINKPAD LAPTOP AC POWER ADAPTER 20V 3.2.5A OEM 92P1156 42T5282
$11.0
IBM Lenovo THINKPAD LAPTOP AC POWER ADAPTER 20V 3.2.5A OEM 92P1156 42T5282 pictureIBM #4 Y Cable Genuine OEM Long POS Cash Register 4A to 4B 10N1002 J96367
$24.99
IBM #4 Y Cable Genuine OEM Long POS Cash Register 4A to 4B 10N1002 J96367 picture






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