BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 05-02-2007, 10:10 PM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: Feb 2007
Model: 8100
Carrier: T-Mobile
Posts: 54
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Argggh, there must be a solution to this!!!

Please Login to Remove!

Hi all,

I'm TRYING to get EditFields working correctly side-by-side in a FlowFieldManager. I have them all aligning as I want, but their edit behavior is broken.

Using the roller ball, you can go from field to field, but the cursor never iterates thru the characters in each field, allowing one to correctly edit them.

This same code, using a HorizontalFieldManager works, BUT, I can not get fields on a second line.

Here's a screenshot of what it looks like:


My goal is to be able to properly edit these fields, while maintaining the correct layout.

Here's my class code.

Any and all help is greatly appreciated.

Code:
package com.wcs.blackberry;

import net.rim.device.api.system.Characters;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.MenuItem;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.component.EditField;
import net.rim.device.api.ui.container.FlowFieldManager;
import net.rim.device.api.ui.container.MainScreen;

import com.wcs.blackberry.util.BBLogger;

// The Sandbox application is a Blackberry Pearl testbed.
public class Sandbox extends UiApplication
{
  public static void main(String[] args)
  {
    Sandbox theApp = new Sandbox();
    theApp.enterEventDispatcher();
  }

  public Sandbox()
  {
    MainScreen screen = new SandboxScreen();
    pushScreen(screen);
  }
}

final class SandboxScreen extends MainScreen
{

  public SandboxScreen()
  {
    super(MainScreen.DEFAULT_MENU | MainScreen.DEFAULT_CLOSE);
    MenuItem menuItem = BBLogger.getShowLogMenuItem();
    addMenuItem(menuItem);

    FlowFieldManager ffm = new FlowFieldManager(
        FlowFieldManager.HORIZONTAL_SCROLL | FlowFieldManager.VERTICAL_SCROLL);

    ffm.add(new FixedWidthField("abc"));
    ffm.add(new FixedWidthField("def"));
    ffm.add(new FixedWidthField("ghi"));
    ffm.add(new FixedWidthField("jkl"));

    add(ffm);
  }

  public class FixedWidthField extends EditField
  {
    public FixedWidthField(String string)
    {
      super("", string, 10, Field.FOCUSABLE);
    }

    public int getPreferredWidth()
    {
      return 80;
    }

    public void layout(int maxWidth, int maxHeight)
    {
      super.layout(getPreferredWidth(), super.getPreferredHeight());
      setExtent(getPreferredWidth(), super.getPreferredHeight());
    }
  }

  public boolean onClose()
  {
    System.exit(0);
    return true;
  }

  public boolean keyChar(char key, int status, int time)
  {
    switch (key)
    {
    case Characters.ESCAPE:
      onClose();
      return true;
    }
    return super.keyChar(key, status, time);
  }
}
Offline  
Old 05-03-2007, 12:35 AM   #2 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2007
Location: India
Model: 8700g
Carrier: Airtel
Posts: 117
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default hi

try this...i am not sure if it works but still....
keep the ALT key pressed when scrolling horizontally.
__________________
Thanks
Meenal
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.