frodo
frodo

Reputation: 1571

GWT Cell Table Hover

I'm using a GWT Cell Table to display data. I needed to display a popup when the user hovers over a column. I used the addCellPreviewHandler to do this ,and it works fine except for the fact that , the popup lingers until the user clicks elsewhere. Would it be possible for the popup to hide when the user navigates out of the column ?

Thanks.

Upvotes: 1

Views: 1919

Answers (1)

Cesar
Cesar

Reputation: 5488

I'm assuming you're doing something like:

table.addCellPreviewHandler(new Handler<IdObject>() {
    @Override
    public void onCellPreview(CellPreviewEvent<IdObject> event) {
        if (BrowserEvents.MOUSEOVER.equals(event.getNativeEvent().getType())) {
            // get the proper cell and show your popup
        } else if (BrowserEvents.MOUSEOUT.equals(event.getNativeEvent().getType())) {
            // hide it
        }
    }
});

You can see which types of events are supported by looking at the BrowserEvents class, there's a bunch of static string values identifying each event.

Upvotes: 5

Related Questions