07-18-2011 09:41 PM - edited 07-18-2011 10:16 PM
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.
07-18-2011 10:13 PM
Can you post the code here?
07-18-2011 10:15 PM
I cannot. I'm just looking to see if anyone else has had similiar issues on OS 7. It is fine on earlier version.
07-18-2011 11:57 PM
07-19-2011 05:34 AM
did u tried with
super(VERTICAL_SCROLL);
Thank u
07-19-2011 08:01 AM
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);
}
}
07-19-2011 09:44 AM
07-19-2011 10:46 AM
Thanks. It is a large custom Manager/List, so I guess I'll just start commenting out sections to see what is affected.
07-19-2011 10:49 AM
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!
07-19-2011 10:56 AM
The virtual height is fine: height[386], virtualHeight[170462]