Kevvvvyp
Kevvvvyp

Reputation: 1774

Put a component in a table column header?

I'm want to put a component e.g. a button as a table column header in vaadin.

Is there anyway to do this?

I had thought I could do:

Button button = new Button();
matrixTable.setVisibleColumns(new Object[] { button });

However the column header is just the package name of the button & not the button itself.

N.b. I am aware of Table Header Clicklisteners this is not what I am after.

Thanks for any help!

Upvotes: 1

Views: 1920

Answers (1)

kukis
kukis

Reputation: 4644

Its not possible at the moment in Vaadin. It is already reported in Vaadin trac and awaits implementation. However you can use various techniques to get desired effect including:

  1. Write your own custom component (maybe based on com.vaadin.ui.Table)
  2. Use CSS to style column header so it will looks and behave (on hover) like button
  3. Use Javascript to inject html components (checkbox, button) and style them with CSS

Upvotes: 3

Related Questions