user3665549
user3665549

Reputation: 43

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

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.

Upvotes: 1

Views: 76

Answers (1)

Andrei Volgin
Andrei Volgin

Reputation: 41089

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 

            }
        }
    });

Upvotes: 2

Related Questions