Skip to content

Simulator TextField misc bugs #957

Description

Original issue 957 created by codenameone on 2013-11-17T21:13:00.000Z:

Netbeans 7.4
Ubuntu 13.1
Oracle JDK 1.7.0_45-b18

tf = new TextField();
tf.addDataChangeListener(new DataChangedListener() {
    public void dataChanged(int type, int index) {
         Log.p("Data changed:" + tf.getText());
    }
});

When I type "abc" i expect a log to show:
Data changed:a
Data changed:ab
Data changed:abc

Instead I see:
Data changed:Ab
Data changed:Abc
Data changed:Abc

The last log is caused by clicking out of the window and back to Netbeans.

Problems

  1. First keypress does not fire a change event.
  2. First character is being capitalized.
  3. Event is being fired by losing focus.

If I turn off native input and run it in a JFrame

    Display.getInstance().callSerially(new Runnable() {
        @Override
        public void run() {
            tmoi.init(null);
            tmoi.start();
            f.setVisible(true);
        }
    });

With the same input I get:

[EDT] 0:0:0,0 - Data changed:A
[EDT] 0:0:0,1 - Data changed:A
[EDT] 0:0:1,467 - Data changed:AB
[EDT] 0:0:1,467 - Data changed:AB
[EDT] 0:0:2,193 - Data changed:ABC
[EDT] 0:0:2,193 - Data changed:ABC

Problems

  1. All of the letters are uppercase.
  2. The change event fires twice for each key.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions