12-05-2012 04:47 AM - edited 12-05-2012 04:49 AM
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 Screen. Then 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 you. Start using keyChar() and "T" to make sure you understand the proocess.
12-05-2012 04:58 AM
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...
12-05-2012 05:03 AM
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?
12-05-2012 05:04 AM
And docn't forget to call super.keyChar if you don't process the key and return true if you do.
12-05-2012 05:59 AM
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..?
12-05-2012 06:40 AM
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().
12-05-2012 07:35 AM
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);
}
12-05-2012 07:44 AM
12-06-2012 12:54 AM
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
12-06-2012 04:56 AM
New question, please ask in a new Thread. Short answer is yes, but research this on the forum, the question has been asked before.