How to delegate event processing from CellList / CellTable to cell's widget in GWT?

84 Views Asked by At

Is there a way to process click event in cell's widget?

I implemented custom complex cell with text and image. Wrap it with FocusPanel and declare a click handler. But CellTable and CellList intercept all events.

1

There are 1 best solutions below

0
On BEST ANSWER

There is a way of doing it directly, no wrapping:

    table.addCellPreviewHandler(new Handler<MyObject>() {

        @Override
        public void onCellPreview(CellPreviewEvent<MyObject> event) {

            if ("click".equals(event.getNativeEvent().getType())) {

                // do something with a click, using event.getColumn(), 
                // event.getIndex() and event.getValue() as necessary 

            }
        }
    });