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
New Developer
Posts: 2
Registered: ‎09-10-2008
My Device: Not Specified
Accepted Solution

Editfield with scrollable text

Hi,

I need a field similar to EditField, but with scrollable text. EditField jumps in a new line if the contents occupy more than one line, but i would like the text to be only in one line, and to be able to scroll it to right and left if it is longer than one line.

How can i do it? 

Thanks! 

Developer
Developer
Posts: 283
Registered: ‎07-22-2008
My Device: Not Specified

Re: Editfield with scrollable text

You can use the EditField, but place it in a HorizontalFieldManager that you create using "HORIZONTAL_SCROLL" as a style.

It will work. I used it int he past.

 

 

 

BlackBerry Development Advisor
Posts: 15,752
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Editfield with scrollable text

Have a look at the sample in this BlackBerry Developer Journal article.  IT may do what you need.

 

http://na.blackberry.com/eng/developers/resources/journals/jul_2005/creating_textbox_field.jsp

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
New Developer
Posts: 2
Registered: ‎09-10-2008
My Device: Not Specified

Re: Editfield with scrollable text

Thank you very much! Both answers helped me.

I used the TextBoxField from BlackBerry Developer Journal article, but instead of VerticalManager vfm I created a HorizontalManager, and added the EditField to it. Now it works fine.

Thank you again! 

Developer
Posts: 265
Registered: ‎08-27-2009
My Device: Not Specified

Re: Editfield with scrollable text

Hey MonikaG How did u soleve ur problem i want to know can pls provide a peace of code....it would be kind enough..thnaking u.....
Developer
Posts: 984
Registered: ‎02-10-2009
My Device: Not Specified

Re: Editfield with scrollable text

Developer
Posts: 265
Registered: ‎08-27-2009
My Device: Not Specified

Re: Editfield with scrollable text

Thank u Bikas...
New Contributor
Posts: 8
Registered: ‎04-14-2010
My Device: 8900-Bold
My Carrier: vcb

Re: Editfield with scrollable text

Hi

 

I used the example...it works fine....but i coulnt scroll it...i couldnot able to select the text...any ideas????

Regular Contributor
Posts: 52
Registered: ‎11-29-2010
My Device: Blackberry 9700

Re: Editfield with scrollable text

I am also facing same problem. I need to crate a scrollable editfield. The editField can increase upto 4 lines after that it must display last 4 lines. On scrolling  up and down user can go through the message. I have gone through the link

http://us.blackberry.com/devjournals/resources/journals/jul_2005/creating_textbox_field.jsp and used the code which is given on the document. On running it, my simulator is not loading the application. Is there any way to display vertical scrollber inside the editfield?

Developer
Posts: 2,268
Registered: ‎07-08-2009
My Device: various
My Carrier: various

Re: Editfield with scrollable text

First of all, stop using that old example - it has some harmful code in it. Here is a knowledge base article which was created specifically to address those problems:

TextBoxField revisited

If you want a scrollbar there, you can replace VerticalFieldManager (vfm) in that code with VerticalScrollManager from the following article (remove VERTICAL_SCROLLBAR from vfm's constructor):

Implementing a standard style scrollbar on a BlackBerry device

Both articles have comments with additional ideas - take a look.

----------------------------------------------------------
please click 'Accept Solution' on posts that provide the solution to the question you've posted. Don't say "Thanks", press 'Like' button instead!