Uriel_SVK Uriel_SVK -4 years ago 154
Java Question

Fill buttons in grid with FontAwesome icons and add tooltips to them

Is there any way to use FontAwesome for buttons in Grid? I tried to make it as an html - but buttos dont parse html but I can only see it as text.

I also tried to make a custom renderer (from https://vaadin.com/forum#!/thread/9418390/9765924) but it does not work - no errors, it just wont change text no matter how i do it.

I would like to have 3 buttons with FontAwesome icons and tooltips in every row. Is there some simple way to do that?

Answer Source

I guess what you want is clickable icons that don't necessarily need to be buttons.

So instead of using ButtonRenderer to add buttons, for which you can only provide a caption, a simple solution is to use HtmlRenderer to add the FontAwesome icon (1 column for each icon), then use an ItemClickListener. Use ItemClickEvent#getPropertyId() to detect which column was clicked.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download