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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Highlighted
Developer
Posts: 367
Registered: ‎11-25-2009
My Device: Not Specified
Accepted Solution

Trouble Scrolling in PopupScreen

Hello,

 

I have added a PopupScreen to my application that will display some text given to it. When the text is displayed, the scroll arrow appears indicating that there is more text to show, however it will not let me scroll when I click down (testing on a BlackBerry with a track ball).

 

The text is displayed in a LabelField (which I believe is not Focusable by default), but even when I say new LabelField("text", Field.FOCUSABLE), it still does not let me scroll down. I have tried adding other fields (such as EditFields) and it seems to work. So I am guessing the issue is with the focus?

 

Can anyone tell me why this is? Here is my code:

 

 

package com.kflicks.ui.Screens;

import java.util.Vector;

import net.rim.device.api.system.*;
import net.rim.device.api.ui.container.*;
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;

public class SynopsisScreen extends PopupScreen implements KeyListener {

	Vector results;

	LabelField label;

	public SynopsisScreen(String synopsis) {
		super(new VerticalFieldManager(VERTICAL_SCROLL | VERTICAL_SCROLLBAR),
				Field.FOCUSABLE);

		label = new LabelField(synopsis);
		add(label);
	}

	public void close() {
		UiApplication.getUiApplication().popScreen(this);
	}

	// ///////////////////////////////////
	// / implementation of Keylistener
	// ///////////////////////////////////
	public boolean keyChar(char key, int status, int time) {
		// intercept the ESC key - exit the app on its receipt
		boolean retval = false;
		switch (key) {
		case Characters.ENTER:
			break;
		case Characters.ESCAPE:
			close();
			break;
		default:
			retval = super.keyChar(key, status, time);
		}
		return retval;
	}

	/** Implementation of KeyListener.keyDown */
	public boolean keyDown(int keycode, int time) {
		return false;
	}

	/** Implementation of KeyListener.keyRepeat */
	public boolean keyRepeat(int keycode, int time) {
		return false;
	}

	/** Implementation of KeyListener.keyStatus */
	public boolean keyStatus(int keycode, int time) {
		return false;
	}

	/** Implementation of KeyListener.keyUp */
	public boolean keyUp(int keycode, int time) {
		return false;
	}
}

 

 

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

Re: Trouble Scrolling in PopupScreen

Try swapping your LabelField for a RichTextField and see if that resolves your issue. 

Developer
Posts: 367
Registered: ‎11-25-2009
My Device: Not Specified

Re: Trouble Scrolling in PopupScreen

That did the trick, thanks!