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
Regular Contributor
abhishek_puppalwar
Posts: 69
Registered: ‎01-17-2010
My Device: 9700 Bold
My Carrier: Airtel

Re: Strange behavior of EditField

please see the code at starting of this post chain, i pasted a code showing what i added to the popup dialog.
AbhishekPXP
Please use plain text.
Developer
tommy20
Posts: 253
Registered: ‎05-18-2011
My Device: Curve 9300, BB10 Dev Alpha C, Z10

Re: Strange behavior of EditField

@: I can confirm you that the two code snippets you provided are working fine. I think that the code you are actual ly using may not be the same.

Can the num_Field on the dialog be got focus?

--tom
Please use plain text.
Developer
arkadyz
Posts: 2,268
Registered: ‎07-08-2009
My Device: various
My Carrier: various

Re: Strange behavior of EditField

Figured it out - the problem is in this little piece of code in your popup screen:

}

        protected boolean keyDown(int keycode, int time) {  
            if(keycode == 1769472){   
                close();
            }
            return true; 

See that "return true" there? It indicates that the screen has consumed the event, thus the field never gets a chance of getting it. A proper way would be to return true inside the if, right after close(), and return super.keyDown(keycode, time) otherwise. Returning false would also work here, but returning super.... is a cleaner way.

----------------------------------------------------------
please click 'Accept Solution' on posts that provide the solution to the question you've posted. Don't say "Thanks", press 'Like' button instead!
Please use plain text.
Regular Contributor
abhishek_puppalwar
Posts: 69
Registered: ‎01-17-2010
My Device: 9700 Bold
My Carrier: Airtel

Re: Strange behavior of EditField

Thanks buddy you are absolutely right. Thanks for the support.
AbhishekPXP
Please use plain text.