S
Simon Brooke
Somebody please give me a clue to where I'm going wrong here!
I've got a barcode scanner which generates the characters of the barcode,
followed by return. It goes into a TextField in a MIDlet form. The MIDlet
implements Command Listener
public class FieldKitMidlet extends MIDlet implements CommandListener
The TextField is just a TextField:
protected TextField inputLine =
new TextField( getConfig( "FieldKitMidlet-InputLabel" ), null,
AbstractFieldKit.MAXINPUT, TextField.ANY );
It has a default command set on it, as follows:
Command enter =
new Command( getConfig( "FieldKitMidlet-EnterLabel" ),
Command.OK, 0 );
inputLine.addCommand( enter);
inputLine.setDefaultCommand( enter );
form.append( inputLine );
In an earlier version of the software, when you clicked the scan button,
the barcode value immediately appeared in the input line, and the command
associated with Command.OK happened automatically. The barcode scanner
software hasn't changed. The commandAction(Command,Displayable) method
hasn't changed.
So what, exactly, are the conditions in which a return character should or
should not trigger the default action on a TextField? What can I do to
make this work again?
I've got a barcode scanner which generates the characters of the barcode,
followed by return. It goes into a TextField in a MIDlet form. The MIDlet
implements Command Listener
public class FieldKitMidlet extends MIDlet implements CommandListener
The TextField is just a TextField:
protected TextField inputLine =
new TextField( getConfig( "FieldKitMidlet-InputLabel" ), null,
AbstractFieldKit.MAXINPUT, TextField.ANY );
It has a default command set on it, as follows:
Command enter =
new Command( getConfig( "FieldKitMidlet-EnterLabel" ),
Command.OK, 0 );
inputLine.addCommand( enter);
inputLine.setDefaultCommand( enter );
form.append( inputLine );
In an earlier version of the software, when you clicked the scan button,
the barcode value immediately appeared in the input line, and the command
associated with Command.OK happened automatically. The barcode scanner
software hasn't changed. The commandAction(Command,Displayable) method
hasn't changed.
So what, exactly, are the conditions in which a return character should or
should not trigger the default action on a TextField? What can I do to
make this work again?