Avoid focus on first screen field in blackberry - blackberry

I've add some customized buttonfield follow by some label field.
When opening the app, the first buttonfield gets focus, but I don't need the focus when opening the screen. How to avoid the focus on opening the screen?

use NullField like the code below:
NullField field = new NullField();
field.setFocus();
This will avoid the focus on any field in the screen

Related

iOS -Objective C- Prevent the keyboard automatically hide when I set enable = NO on UITextField

I'm working on an App with Objective-C but I have a problem with my form.
I have several inputs view (UITextField) on it, and one with a particularly behavior.
When I select the checkbox, I prevent the user typing on the view and looks the view as disable( grayed out and without the blue bar flashing blue bar ) and keep the keyboard open.
When I set the UITextField as disable, the keyboard is automatically hidden.
Someone knows how to keep the keyboard open?
I need to something like the image attached, but without the blue bar flashing blue bar.
I did the logic to prevent the the user enter data on the input , but the keyboard is automatically hidden.
If the text field is disabled, the user cannot type into it and the dismissal of the keyboard is correct. You should not try to fight against that. (It sounds like you're trying to disable the keyboard for the wrong reasons anyway.)
In this case, it sounds like your timing is just off. When the user clicks the checkbox, your code responds. What you are doing there is just wrong. You should respond by moving the first responder to the next enabled text field yourself, and then disabling the first text field. That way, you are not disabling the text field while it is first responder; that's your whole mistake right there.

How to show keyboard programmatically in Firefox OS?

I am working on a ToDo list app wherein I keep the focus on the textbox input after the user adds a ToDo item.
Now, the problem is, when the user adds some text input and hits the add button, the focus on the textbox is lost so the keyboard disappears and then the focus gets back to the textbox. So, the keyboard disappears and appears again in a short interval. As you can imagine, this is bad UX.
How do I set the keyboard to be shown explicitly when the focus is on the input button?
I fixed it by setting the focus onto the textbox first when I click the add button then do the actual adding stuff.

ObjectChoiceField automatically scroll to top after selecting a choice?

I have customized a field which contains an ObjectChoiceField. After clicking a choice,the screen just scrolls to the top and the choice field drops down from the visibile screen。Pls tell me how to prevent this。Thank you。
You can find out custom drop down list implementation in this thread: Issue in PopUpScreen
This custom drop down does what you want.

Losing Focus From A JTextField

After I use my textfield I can't get a jpanel that click on back into focus for my keylistener. It works for the mouselistener but all other keystrokes keep being detected by the textfield not the jpanel.
The panel has been setFocusable(true) and works fine until i give the textfield the keyboard focus. It's like the textfield won't release the focus.
Any suggestions?
The answer was to call requestFocus() on the panel after the text action was performed

Custom HorizontalFieldManager menu not showing

I have created a class that extends HorizontalFieldManager so that I can display a label and an image on the same line with the label to the left and the image to the right. I want the user to be able to interact with the hfm as if it were a single field. I have everything working (focus, click action, etc) except the menu. When I press the menu button makeMenu and makeContextMenu are not called. How do I make it so that the correct menu shows when the menu button is clicked and focus is on the hfm? Am I going about this the wrong way?
Where do you override makeContextMenu, in the Hfm? You might have to override them in the label and image.
Or, less elegantly, you could just check in the makeMenu() function of your screen if the hfm has focus (or its children) and then add your menu item there.

Resources