Vaadin code:
@Route("")
@JsModule("./src/testen_funktion.js")
public class HelloWorldView extends VerticalLayout {
private Button button = new Button();
public HelloWorldView() {
add(button);
button.setText("Testen");
button.addThemeVariants(ButtonVariant.LUMO_PRIMARY);
button.addClickListener(event -> {
getElement().executeJs("registerWebAuthn2(this)")
.then(encodedCredential -> {
// some code
}
});
});
}
I use the executeJs() function to call a Js function called registerWebAuthn2 in the testen_funktion.js.
Java code:
public class TestTool {
public static void main(String[] args) throws IllegalArgumentException, NoSuchAlgorithmException {
MFAClientTool client = new MFAClientTool("https://test-server.com", "testuser",
"password");
// the rest of the code
}
}
My question is how to use the method from the class TestTool inside the class HelloWorldView. I suppose I have to use the @ClientCallable annotation. Can you help me here?