2

So i have a GWT cellTable with various inputs, including selectboxes, EditTextCells and some links. I would like TAB to go along each cell.

However, currently i can only get the TAB switching to go between the selectboxes(when KeyboardSelectionPolicy.DISABLED). (ie from here). But it doesnt tab to the EditTextCells or other cells.

(potentially relatedly, EditText <input>s seem like they cannot have their tabindex!=-1, or else i see the cellTable throwing errors. (and it seems to warn in EditText that you shouldnt do this).

is there another tabIndex for EditText or other generic cells that I'm missing maybe? One guy here seemed like he couldnt get it to work and opt'd out.

But according to this issue at googleCode, other people are doing this successfully.

Community
  • 1
  • 1
user824378
  • 21
  • 2

2 Answers2

0

You can create a new Cell. Or, you can add some script to the CellTable to handle TABs and SHIFT+TABs.

Extend CellTable to achieve this by adding a tab handler would work for your needs. See this link.

pMan
  • 8,808
  • 11
  • 32
  • 35
0

ok so adding the tabIndex does work. for editTextCell I added a new Template for the (normally just safehtml-rendered) text like this:

interface TemplateBasic extends SafeHtmlTemplates {
        @Template("<Label tabindex=\"{1}\">{0}</Label>")
        SafeHtml input(String value, String index);
      }

and then later in render when it sets ...

else if (value != null) {
      SafeHtml html = renderer.render(value);
      sb.append(html) );
}

instead i used

else if (value != null) {
      SafeHtml html = renderer.render(value);
      sb.append(templatebasic.input(html.asString(), Integer.toString( context.getIndex() )) );
    }

this should work for the checkboxcell too; overriding the renderer not to use the static defined INPUT_CHECKED/UNCHECKED with the tabIndex=-1

but im still thinking/hoping there might be a better way....

user824378
  • 21
  • 2