LitRenderer with special function names don't work

Please mention in the docs, that a template used by a grid column litRenderer can’'t have certain function names: it took me an hour to detect, why the column remains empty for the following lit template:

<vaadin-icon icon='vaadin:trash' style='fill:darkred' @click='${delete}'></vaadin-icon>

but works perfectly for

<vaadin-icon icon='vaadin:trash' style='fill:darkred' @click='${deleteInvoice}'></vaadin-icon>

And yes, the used function name value was set properly :slight_smile:

.withFunction("...", this::delete)

It’s hard to detect because the columns remains empty and the browser console only shows:

Uncaught SyntaxError: missing variable name
    setLitRenderer http://localhost:8080/VAADIN/build/generated-flow-imports-C7SjgTG7.js:15907

Kind regards
Dominik

Hi @todo42

Well it worked… it deleted the object :slight_smile:

delete is a reserved keyword in JavaScript

This limitation is mentioned in the withFunction’s Javadoc: https://vaadin.com/api/platform/24.4.3/com/vaadin/flow/data/renderer/LitRenderer.html#withFunction(java.lang.String,com.vaadin.flow.function.SerializableConsumer)

The error message could be more precise though

Thanks guys for your fast response.
I already thought it was something along these lines, but it’s nice to have it confirmed by you here.