01-19-2011 02:00 PM
Hello friends. I'm trying to create a textfield that automatically scrolls horizontally when the field gets full. I'm using a custom TextField Class shown below which I've reduced for simplicities sake. I've also included the call I'm using. Any ideas why this wouldn't produce a horiztontally scrolling textfield? Thanks everyone much love.
//Creating a new TextField within a HorizontalFieldManager
HorizontalFieldManager mgrFirstName = new HorizontalFieldManager(HORIZONTAL_SCROLL);
TextField FirstName = new TextField(BasicEditField.NO_NEWLINE, HORIZONTAL_SCROLL);
/* Custom TextField Class */
public class TextField extends HorizontalFieldManager
public BasicEditField bEdit = null;
public TextField(long Style, long scroll)
bEdit = new BasicEditField(Style);
Solved! Go to Solution.
01-19-2011 02:21 PM
Here is a link to a knowledge base article which solves this problem. If you want to beautify the gadget, make sure to read the comments:
01-19-2011 03:21 PM
The article shows something else - you need to envelop the field with a Manager with HORIZONTAL_SCROLL in order for it to work. Use the whole gadget (class OneLineTextField) instead of parts of it.
10-16-2011 06:18 AM - edited 10-16-2011 06:20 AM
The horizontal scroll works well no doubt when adding chars. However my problem is that while deleting chars once they have gone beyond the fld size. The chars get deleted till one one char is displayed in the field and then the earlier entered chars start to get displayed.
Expected Behaviour: While deleting chars the cursor shud remain at end of field till the no. of chars are greater than width of the field.
So what could be the solution to this?
10-16-2011 01:46 PM
This is expected. The code, after all, uses BlackBerry standard fields and managers, and a manager does not change its scrolling position unless focus rectangle becomes outside of the current visible region. Your "expected behaviour" is not at all expected - it is the way Windows implements its own scrolling text box, which is not present in the BlackBerry OS.
If you want to design your own field/manager behaving like you've described, start a separate topic and we can ponder some ideas. Posting in a solved thread is almost useless - people mostly skip them thinking that there is nothing more to discuss.