1

I'm a newbie in blackberry development and stuck on a code section regarding the Spinboxfield and non-touch devices. I will appreciate any help, code sample reply or links to relevant tutorials that shows how to use the spinboxfield on a non-touch device (e.g. a blackberry curve or a bold 3). The problem occurs when a screen contains a spinfield and another control e.g.button. Scrolling from the spinboxfield to the button is quite impossible cos once the user enters the spinboxfieldmanager area, they are unable to navigate to the button control and the user is stuck within the spinboxfield control. I have tried the code "SpinBoxFieldManager.setClickToLock(false)" but this doesn't work. Example code is shown below

// an array of choices for the months.
      final String[] MONTHS = { "January", "February", "March", "April", "May", "June",
          "July", "August", "September", "October", "November", "December"};

      // an array of choices for years
      final String[] YEARS = { "2001", "2002", "2003", "2004", "2005", "2006", "2007",
          "2008", "2009", "2010", "2011", "2012", "2013", "2014"};

      // use a text spin box to display these choices
      SpinBoxField monthSpinBox = new TextSpinBoxField(MONTHS);
      SpinBoxField _yearsSpinBox = new TextSpinBoxField(YEARS);

      // create a manager for these spin boxes
      SpinBoxFieldManager spinBoxManager = new SpinBoxFieldManager();

      // add the spin boxes
      spinBoxManager.add(monthSpinBox);
      spinBoxManager.add(yearsSpinBox);
      spinBoxManager.setClickToLock(false);

      this.add(spinBoxManager);

      ButtonField mybutton = new ButtonField("MY Button", ButtonField.CONSUME_CLICK);
      mybutton.setChangeListener(this);

      this.add(mybutton);

Apparently using the keypad to scroll from the spinboxfield to the button is impossible except on touch devices.

Thanks in advance.

Akinslove
  • 109
  • 1
  • 7

1 Answers1

0

http://docs.blackberry.com/en/developers/deliverables/24222/Spin_boxes_887725_11.jsp

Best practice:

...

  • Avoid using a spin box if several other components appear on the screen.

I would use a popup-screen to display the spin box, as the image on the page suggests.

G B
  • 2,951
  • 2
  • 28
  • 50
  • Thanks G B, Strange the Spin box can't easily allow multiple controls on same screen compared to the iphone. Would keep that in mind. – Akinslove May 11 '12 at 16:18
  • I think the issue is not the SpinBox itself, but the size it needs to be useful, especially when used on some of the smaller screen devices. I see no problem using multiple SpinBoxes on a portrait mode Torch for example. – Peter Strange Aug 21 '13 at 17:56