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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Developer
mreed
Posts: 1,023
Registered: ‎07-16-2008

ListField scrolling in OS 7

[ Edited ]

We have a ListField inside of a scrollable Manager, and on OS 7 we are not able to scroll through the ListField using touch events or the trackpad. The selected row changes, however the Manager does not scroll vertically when a row off the screen becomes selected.

 

The ScrollChangeListener is not even being called.

 

Any ideas?

 

I'm seeing this on the OS 7.0.0.218 9930 simulator.

Please use plain text.
Developer
tommy20
Posts: 171
Registered: ‎05-18-2011

Re: ListField scrolling in OS 7

Can you post the code here?

--tom
Please use plain text.
Developer
mreed
Posts: 1,023
Registered: ‎07-16-2008

Re: ListField scrolling in OS 7

I cannot. I'm just looking to see if anyone else has had similiar issues on OS 7. It is fine on earlier version.

Please use plain text.
Developer
tommy20
Posts: 171
Registered: ‎05-18-2011

Re: ListField scrolling in OS 7

You may want to use SimpleList, RichList, or TableView instead.
--tom
Please use plain text.
Regular Contributor
nag
Posts: 96
Registered: ‎06-09-2011
My Carrier: java development

Re: ListField scrolling in OS 7

did u tried with

super(VERTICAL_SCROLL);

 

 

 

 

Thank u

Press the Kudos button (star) on the left side to thank and
please mark the Thread as solved if its solved...


Thanks and Regards
Nagarjuna
Please use plain text.
Developer
tommy20
Posts: 171
Registered: ‎05-18-2011

Re: ListField scrolling in OS 7

This simple code just works perfectly on the 9930 simulator (OS 7.0.0.218). So, this confirm that your problem is from your code, not from the OS or simulator.

import java.util.Vector;

import net.rim.device.api.system.Display;
import net.rim.device.api.ui.Graphics;
import net.rim.device.api.ui.component.ListField;
import net.rim.device.api.ui.component.ListFieldCallback;
import net.rim.device.api.ui.container.MainScreen;

public final class MyScreen extends MainScreen implements ListFieldCallback {
	Vector v = new Vector();
	public MyScreen() {
		for(int i = 1; i <= 50; i++){
			v.addElement("Item " + i);
		}
		
		ListField l = new ListField();
		l.setCallback(this);
		l.setSize(v.size());
		add(l);
	}

	public void drawListRow(ListField listField, Graphics g, int index, int y, int width) {
		if (index > -1 && index < v.size()) {
			g.drawText((String)v.elementAt(index), 4, y + 2, 0, width);
		}
	}

	public Object get(ListField listField, int index) {
		if (index > -1 && index < v.size()) {
			return v.elementAt(index);
		}
		return null;
	}

	public int getPreferredWidth(ListField listField) {
		return (Display.getWidth());
	}

	public int indexOfList(ListField listField, String prefix, int start) {
		return (-1);
	}
}

 

--tom
Please use plain text.
Developer
dnepr
Posts: 723
Registered: ‎03-12-2009

Re: ListField scrolling in OS 7

If your scrollable manager overrides sublayout I would look in there. Make sure virtual extent is set to a proper value.

I have the same concept as you do, list field inside a scrollable manager and it works fine on all OS7 sims/devices.

Hope that helps.
Please use plain text.
Developer
mreed
Posts: 1,023
Registered: ‎07-16-2008

Re: ListField scrolling in OS 7

Thanks. It is a large custom Manager/List, so I guess I'll just start commenting out sections to see what is affected.

Please use plain text.
Developer
hendrik
Posts: 48
Registered: ‎09-10-2009
My Carrier: O2 Germany

Re: ListField scrolling in OS 7


dnepr wrote:
If your scrollable manager overrides sublayout I would look in there. Make sure virtual extent is set to a proper value.


Good advice! Just tried and changed this in a manager of my own: In the sublayout method I first set the extent to the minimum of the available height and my used height, which might exceed the available height, then I set the virtual extent to my used height. Works perfectly!

----

My Twitter: @hendrik_dev
Please use plain text.
Developer
mreed
Posts: 1,023
Registered: ‎07-16-2008

Re: ListField scrolling in OS 7

The virtual height is fine:  height[386], virtualHeight[170462]

Please use plain text.