Welcome to the Official BlackBerry® Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Developer
richard_puckett
Posts: 191
Registered: 04-03-2008
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.
Please use plain text.
Developer
mreed
Posts: 799
Registered: 07-16-2008

Re: Scroll BasicEditField instead of wrap

Have you tried overriding the width (and extent) and sticking it into a HorizontalFieldManager?
Please use plain text.
Developer
richard_puckett
Posts: 191
Registered: 04-03-2008

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);

 

Please use plain text.
Developer
Doctor
Posts: 73
Registered: 07-15-2008

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 

Please use plain text.
Developer
Radres1
Posts: 21
Registered: 03-27-2009

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).
Please use plain text.
New Developer
renuka_anil
Posts: 30
Registered: 11-17-2008

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

Please use plain text.