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
Contributor
graymatter
Posts: 28
Registered: ‎07-29-2010
My Device: Torch 9850
Accepted Solution

EditField & ButtonField on the same line

First off, I would like to apologise in advance if there is already a resolution for this issue, I've been searching google on and off for a few days while working on other parts of my application but have been unable to find any advice.

 

I'm not new to programming, but am fairly new to java and very new to programming the BlackBerry hence I've been working on something relatively simple so I can get used to the UI programming.  One issue I have been unable to resolve is how to place an EditField and a ButtonField on the same line with the ButtonField sitting up against the right hand marging and the EditField taking up the space from the left hand margin to the start of the ButtonField.  Graphically, this is what I'm trying to achieve:

 

|[-----EditField-------][-ButtonField-]|

 

I've tried placing the two fields inside the same HorizontalFieldManager as well as placing each field within it's own Vertical or HorizontalFieldManager.  I've also tried using the FIELD_LEFT / FIELD_RIGHT styles but cannot find a way of stopping the EditField from pushing the ButtonField off of the screen and using the whole line width for itself.

 

I'm beginning to suspect that I need to learn how to code a custom field manager, is this the case or is there something much simpler that I'm missing?

 

Thanks in advance,

 

Russ.

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

Re: EditField & ButtonField on the same line

The following Threads should explain what is going on here and give you sample code that will help you overcome the problem:

 

http://supportforums.blackberry.com/t5/Java-Development/BasicEditFields-won-t-show-up-in-HorizontalF...

 

http://supportforums.blackberry.com/t5/Java-Development/Custom-Field/m-p/392585#M76156

Contributor
graymatter
Posts: 28
Registered: ‎07-29-2010
My Device: Torch 9850

Re: EditField & ButtonField on the same line

Thank you Peter for pointing me in the right direction!