I use LitRenderer to add a checkbox column to a grid. When using an <input type="checkbox">
, the following code works:
final LitRenderer<Row> litRenderer = LitRenderer.<Row>of(
"<input type='checkbox' @change=${e => changed(e.target.checked)}>");
litRenderer.withFunction("changed", (row, args) -> {
boolean checkedValue = args.getBoolean(0);
System.out.println("Row: " + row.getId() + " Current value: " + checkedValue));
});
addColumn(litRenderer);
However, when I use a <vaadin-checkbox>
, the changed
function is not called:
final LitRenderer<Row> litRenderer = LitRenderer.<Row>of(
"<vaadin-checkbox @change=${e => changed(e.detail.value)}></vaadin-checkbox>");
Even replacing @change
with @checked-changed
does not trigger the changed
function.
I would prefer to use <vaadin-checkbox>
since it conforms to the application’s theme.
(Edit) Note: this is on 24.7.0. It used to work on 24.3.x