Welcome!

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

Reply
Developer
peter_strange
Posts: 19,595
Registered: ‎07-14-2008
My Device: Not Specified

Re: Help me to solve this issue in listfield

[ Edited ]

When you say

not able to go next screen"

I presume you mean that you are not able to tab between the two listless

 

Override keyChar() in the ScreenThen in keyChar() detect a key - say "T", and if you have a "T" character, and the focus is on one of your ListFields, then just setFocus on the other one

 

You will struggle to get the "alt" key to do this for youStart using keyChar() and "T" to make sure you understand the proocess

Please use plain text.
Developer
ravi1989
Posts: 773
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0

Re: Help me to solve this issue in listfield

Sorry for that "not able to go next screen"

 

i understand this method

 

protected boolean keyChar(char key, int status, int time) {
Dialog.alert(""+key);
if(key==Keypad.KEY_ALT){
Dialog.alert(""+key);
}
//Dialog.alert(""+key);
return true;
};

 

dialog is display but when i press alt button it will not display anything...

Please use plain text.
Developer
peter_strange
Posts: 19,595
Registered: ‎07-14-2008
My Device: Not Specified

Re: Help me to solve this issue in listfield

Like I said, get the process working with "T" first, then we can talk about alt. 

 

Have you noted my correction on your other Thread?

Please use plain text.
Developer
peter_strange
Posts: 19,595
Registered: ‎07-14-2008
My Device: Not Specified

Re: Help me to solve this issue in listfield

And docn't forget to call super.keyChar if you don't process the key and return true if you do. 

Please use plain text.
Developer
ravi1989
Posts: 773
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0

Re: Help me to solve this issue in listfield

protected boolean keyChar(char key, int status, int time) {
if(key=='t'||key=='T'){

colourList_2.setFocus();

}
return true;
};

 

using this i am able to go to next list field..

 

if i want to do to do the same thing using "alt + trackpad down" how can i do this..?

Please use plain text.
Developer
peter_strange
Posts: 19,595
Registered: ‎07-14-2008
My Device: Not Specified

Re: Help me to solve this issue in listfield

Can you please review the all the information that is contained in a post, and make sure you implement it all as described.  If you don't understand it, then seek clarification. 

 

Your implementation in keyChar is not what I suggested.  This code is potentially faulty - if you have any text input on the screen, then this code will stop you typing a "T" into it.  As I noted before, you should check which Field has focus, and use the "T" to swap between the two, but ONLY when the ListFields have focus.  The return true.  Otherwise return super.keyChar().  I don't care that you don't have any other Fields on the screen.  You will try to use code like this in other place (or someone reading this forum will) - and as coded it is not a good sample.  OK?

 

Regarding how to capture "alt", remember that alt is not really a key press, it is a key modifier.  Like "Shift", which isn't a key press as such, but it tells the processing that the key should be upper or lower case.  For this reason, alt doesn't cause a keyChar invocation.  But you will find the status int passed into keyChar will tell you if "alt" has been pressed. 

 

But if you look there are other key listener methods, from memory one of keyControl, or keyStatus will find "alt" when pressed by itself.  So override these, put some debugging in these methods and find out which is invoked by "alt".  And please do it properly as I suggested for keyChar().

 

Note: To find if either ListField is in focus, you can use getLeafFieldWithFocus(). 

Please use plain text.
Developer
ravi1989
Posts: 773
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0

Re: Help me to solve this issue in listfield

Hello sir i understand and i implement this. but one probblem is that  when list toggle it goes to last focus row , not the zero row of listfield..can you suggest..

 

i used this code

 

protected boolean keyChar(char key, int status, int time) {
if(colourList_1 == getLeafFieldWithFocus()){
if(key=='t'||key=='T'){

colourList_2.setFocus();

}
return true;
}
else{
return super.keyChar(key,status,time);

}

Please use plain text.
Developer
simon_hain
Posts: 15,806
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Help me to solve this issue in listfield

use setselectedrow.
(maybe in an invokelater after setfocus, if it does not work without)
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
ravi1989
Posts: 773
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0

Re: Help me to solve this issue in listfield

Hello 

 

is there any way to scroll the listfield horizontally ..any my listfield is scrolling vertically .if i have lage number of column then can i scroll list horizontally ...?

 

 

Thanks

Regards

Please use plain text.
Developer
peter_strange
Posts: 19,595
Registered: ‎07-14-2008
My Device: Not Specified

Re: Help me to solve this issue in listfield

New question, please ask in a new Thread.  Short answer is yes, but research this on the forum, the question has been asked before. 

Please use plain text.