Paste event

Hi I am trying to get paste data ,

getElement().addEventListener(“paste”,(ev)-> {
System.out.println(ev.getEventData());
});

the paste event get fired, but no data (empty json object) , any ideas ?

You should specify the evend data that you want on the server side

@versatile-zorse I have tried… but not success. I am expecting as simple String from your (copy 6 digits from email) eg 123456,

Are you trying to set clipboard data from the server?

Works for me with addEventData()

String CLIPBOARD_EVENT_DATA_EXPR = "event.clipboardData.getData(\"text\")";
        info.getElement().addEventListener("paste", ev -> {
            System.out.println("======================== PASTED: " +
                    ev.getEventData().getString(CLIPBOARD_EVENT_DATA_EXPR));
        }).addEventData(CLIPBOARD_EVENT_DATA_EXPR);

Got it :slightly_smiling_face: