Any Code Example for PendingJavaScriptResult ?


I’ve read that I have to use “PendingJavaScriptResult” if I want to receive parameters from the client in the server. Unfortunately I can’t find a code example for it. Can you show me a small useful code example for using “PendingJavaScriptResult”?

Thanks in advance

PendingJavaScriptResult is the return value from methods such as Page::executeJs. Usually you would use it fluently with executeJs by invoking the .then method like this:

        UI.getCurrent().getPage().executeJs("return 'hello';").then(String.class, text -> {
            System.out.println("Javascript returned " + text);