0

In GWT Celltable while editing EditTextCell the textbox value gets selected by default, how to remove this default selection?

you can check this celltable showcase for EditText also,

http://gwt.googleusercontent.com/samples/Showcase/Showcase.html#!CwCellSampler

Ayyanar G
  • 1,545
  • 1
  • 11
  • 24

1 Answers1

0

When you click on an EditTextCell, it calls the edit method which focus and select the content:

See here

protected void edit(Context context, Element parent, String value) {
    setValue(context, parent, value);
    InputElement input = getInputElement(parent);
    input.focus();
    input.select(); /* HERE */
}

Maybe you can create a custom class extending EditTextCell, overriding this method without the last line...

BartoszKP
  • 34,786
  • 15
  • 102
  • 130
Philippe Gonday
  • 1,747
  • 5
  • 21
  • 32
  • Yes i override edit method and removed input.select(), now the selection gone but the focus is on the starting of the text, how to reset focus to the end of the text? – Ayyanar G Oct 17 '13 at 06:12
  • Sorry I have no clue about moving the cursor with GWT function... This is possible in javascript: http://stackoverflow.com/questions/512528/set-cursor-position-in-html-textbox – Philippe Gonday Oct 17 '13 at 11:51