Question

So i have here a Cellbutton :

        Column<dateiles, String> column_2 = new Column<dateiles, String>(new ButtonCell()) {
        @Override
        public String getValue(dateiles object) {
            int s = object.comments.size();
            String ss = String.valueOf(s);
            return ss;
        }

    };
    cellTable.addColumn(column_2, "Comments");
    cellTable.setColumnWidth(column_2, "100px");

i want to add to my buttons for each cell column a Tooltip but how is it possible

Was it helpful?

Solution

this.addCellPreviewHandler(new Handler<Tabletype>() {

            @Override
            public void onCellPreview(final CellPreviewEvent<Tabletype> event) {
                int columnID = event.getColumn();

            }
        });

    }

Just replace tabletype with the object you definded when instantiating the table ( The T of CellTable<T> ) Then with the columnID you can detect the right column.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top