0 Replies Latest reply on Oct 19, 2010 4:12 AM by 630423

    The TextBox's getCaretPosition return incorrect result !

      Hi all,

      I have a problem with TextBox when call getCaretPosition(). I wrote Test class with a constructor such as:

      public Test(){
      txt = new TextBox("textbox", "abcde", 50, TextField.ANY);
      txt.addCommand(new Command("abc", Command.SCREEN, 1));
      txt.addCommand(new Command("123", Command.SCREEN, 2));
      txt.addCommand(new Command("456", Command.SCREEN, 3));


      public void commandAction(Command c, Displayable d) {
      } ------------------------------

      If inside Test constructor has only two Commands, calling getCaretPosition is alway correct ! But more than two commands such above, result alway is 5 (my cursor always end of abcde)
      Give me a solution for this problem ?? Thanks.