05-28-2009 09:30 AM
05-28-2009 09:43 AM
This happens as expected, when you update a layout it is common for the screen to go to the start.. To work around this to get your expected results, find which field has the focus currently(before calling update layout), and then setFocus to that field after the update layout..
Cheers..
05-08-2012 11:05 PM
hi,
i am trying to scroll verticalfield to a specific point(height) and make the field show on top of the page by calling setVerticalScroll() witin the layout method of the field:
protected void layout(int width, int height) {
_setExtent(getPreferredWidth(), getPreferredHeight());
// To try to scroll the list so that the focus field is shown on top of the page
if (this.getIndex() == this.getManager().getField(this.getManager().getFi
this.getManager().setVerticalScroll(this.getManage
}
}
but the field doesnt scroll to the position. it however scrolls to the visible rect of the screen since the field's focus is true.
Can you please tell why the is not working...
Thanks
05-09-2012 11:13 AM
One of the absolute first things to do in such cases is to wrap your setVerticalScroll in invokeLater. Calculate the position into a final int and invokeLater the setVerticalScroll call.
The reason is simple - since you don't know in what order the BB framework invokes fields' methods, you want to make sure your setVerticalScroll runs after the UI engine has completely finished the layout update.
See if that helps.
05-10-2012 06:15 AM