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
Posts: 191
Registered: ‎04-03-2008
My Device: Bold 9700
Accepted Solution

Scroll BasicEditField instead of wrap

When typing in a BasicEditField, if input goes beyond its width it will wrap the input text to the next line.  Is there any way to get it to scroll the overflowing input text off to the left instead?  TIA.
Developer
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: Scroll BasicEditField instead of wrap

Have you tried overriding the width (and extent) and sticking it into a HorizontalFieldManager?
Developer
Posts: 191
Registered: ‎04-03-2008
My Device: Bold 9700

Re: Scroll BasicEditField instead of wrap

Sweet.  That did it.  I already had it in a VerticalFieldManager for a different reason so it was an easy switch-over.  The nice thing is that we don't even have to override layout since it gets The Huge Number as an available width due to being in a scrollable HFM.  Thanks!

 

HorizontalFieldManager hfm = new HorizontalFieldManager(Manager.HORIZONTAL_SCROLL | Manager.NO_HORIZONTAL_SCROLLBAR); BasicEditField bef = new BasicEditField(); hfm.add(bef); add(hfm);

 

Developer
Posts: 73
Registered: ‎07-15-2008
My Device: Not Specified

Re: Scroll BasicEditField instead of wrap

Hi Richard,

 

I tried the exact code which you have mentioned. But still the input is going into the next line instead of the input being scrolled. :smileyindifferent:

 

Can you please tell if you're doing anything else, too? I mean other than the code you've mentioned?

 

 

Thanks,

- Rohan 

Developer
Posts: 21
Registered: ‎03-27-2009
My Device: Not Specified

Re: Scroll BasicEditField instead of wrap

I think the missing piece is you have to set the NO_NEWLINE style on your BasicEditField, i.e. BasicEditField bef = new BasicEditField(BasicEditField.NO_NEWLINE).
New Developer
Posts: 30
Registered: ‎11-17-2008
My Device: Not Specified

Re: Scroll BasicEditField instead of wrap

I have set BasicEditField property NO_NEWLINE and horizontalfieldmanager horizontalscroll

The maximum charatcers allowed to enter are 200 but field width is fixed 150.

My text is not scrolling when i enter and the text length is greater than length.

 

Can any body tell me the solution for this.

 

Thanks