Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vaadin - How to convert a Grid column which has boolean value to Checkbox

I am using Vaadin 7.6.4 for my UI work. This has the following:-

  • I have a window which contains a grid with data in it. This window is actually a kind of a pop up[ which shows up when my main screen gets a click on the settings icon( not shown here). This is working fine( getting the UI screen to open the Vaadin window when the settings icon the main screen is clicked).
  • The problem is in showing the data as mentioned below.
  • This grid will have 4 columns for which the data comes from a bean container.
  • The first column is a boolean field with true/false getting displayed based on the data from the bean container.
  • I need to convert this boolean field column into a checkbox with true showing the field as a checkbox with a value selected. If the value is false, then show a checkbox which is not selected.
  • I am trying to do that as shown in the code below but I keep getting this checkbox name printed. I dont see the checkbox but the word "checkbox" printed in there?
  • This checkbox should be editable. The idea is that the user should be able to select some checkboxes and the ones selected should be shown in a panel ( not shown here). Thus, the checkbox has to be editable.

How do I fix this?

like image 620
jbdundas Avatar asked Oct 16 '25 20:10

jbdundas


2 Answers

Ok, we used the SelectionMode.MULTI to show the selection of rows in there. https://cdn.vaadin.com/vaadin-core-elements/latest/vaadin-grid/demo/selection.html

Still, I would love to learn more as to how we get the change done as shown in the question above.

Still looking for an answer to that.

like image 134
jbdundas Avatar answered Oct 19 '25 13:10

jbdundas


Use a Renderer and a Converter, you don't need to use SelectionMode.MULTI.

An example of this is posted here.

like image 33
Víctor Gómez Avatar answered Oct 19 '25 13:10

Víctor Gómez



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!