0 Replies Latest reply: Oct 18, 2010 11:12 PM by 630423 RSS

    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.