GWT Cell Table selection with Checkbox

59 Views Asked by At

I'm trying to replicate in my project this GWT example, but I can't get my code to work correctly, I do not recieve any error but the CheckBox simple do not show up.

this is my code

      public static final ProvidesKey<InventarioByNegDTO> KEY_PROVIDER = new ProvidesKey<InventarioByNegDTO>() {
            @Override
            public Object getKey(InventarioByNegDTO item) {
                return item == null ? null : item.getKey();
            }
        };
        final SelectionModel<InventarioByNegDTO> selectionModel = new MultiSelectionModel<>(
                KEY_PROVIDER);


 ...
   buildTable(){
     negoziTable.addColumn(checkColumn,"Test");
            negoziTable.setColumnWidth(checkColumn, 10d, Style.Unit.PCT);

            selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
                @Override
                public void onSelectionChange(SelectionChangeEvent selectionChangeEvent) {
                    Window.alert(selectionChangeEvent.toDebugString());
                }
            });

            negoziTable.setSelectionModel(selectionModel,
                    DefaultSelectionEventManager.<InventarioByNegDTO> createCheckboxManager(negoziTable.getColumnIndex(checkColumn)));
}

The buildTable is called @PostCostruct.

Actually if I look into the source code of the generated page the checkbox is in it.

<div style="outline-style:none;" __gwt_cell="cell-gwt-uid-84">
     <input type="checkbox" tabindex="-1">
</div>

but is not visible in the page.

Where am I doing wrong?

0

There are 0 best solutions below