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
tylerjames
Posts: 42
Registered: ‎10-06-2008
My Device: Not Specified

Want to setFocus on EditField on Storm without implementing touchEvent methods

Hey everyone,

I've been trying to get an app to work on the Storm without overriding the touchEvent() method (and thereby breaking compatablity with previous OS versions). So far most everything works, but I've hit a little snag.

I have an EditField that I would like to four lines high, I've set the extent and virtualExtent of the field to indicate that it should be this high. I want to be able to click anywhere in those four lines and setFocus on the EditField. Currently the focus will only be set if I touch the first line of the EditField (when the field is empty). If there is text on the other four lines then I can touch there and focus will be set. I would like to be able to set focus to the field, even when empty, by touching anywhere inside the field's extent.

Any ideas how to do this?

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

Re: Want to setFocus on EditField on Storm without implementing touchEvent methods

i would say you could do this with navigationclick, getFieldAtLocation(int x, int y) and setfocus. did not test it myself though
----------------------------------------------------------
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
Posts: 432
Registered: ‎02-23-2009
My Device: Not Specified

Re: Want to setFocus on EditField on Storm without implementing touchEvent methods

Use MainScreen, on MainScreen you need not to implement touchEvent(). MainScreen will manage all the events of touch.

 

 

 


Press the kudos button to thank the user who helped you.

If your problem was get solved then please mark the thread as "Accepted solution".

 

 

Deepesh Gupta
Please use plain text.