@JsModule("test.js")
public class TestPage extends Composite<VerticalLayout> {
private Button buttonPrimary0 = new Button();
public TestPage() {
buttonPrimary0.setText("Create token");
buttonPrimary0.setWidthFull();
buttonPrimary0.addThemeVariants(ButtonVariant.LUMO_PRIMARY);
layoutColumn2.add(buttonPrimary0);
buttonPrimary0.addClickListener(e -> {
UI.getCurrent().getPage().executeJs("register");
});
}
}
This is the JavaScript file which needs to attached to the button (already done).
The function ´register´ should be performed and fetch server-side data. Of course these
information should be printed out.
The line UI.getCurrent().getPage().executeJs(“register($0);”, webAuthnRegisterRequest); is the problem. The 2nd parameter webAuthnRegisterRequest is marked red.
Background: I need a WebAuthn token to be created on a privacyIDEA server. For this process I need some data. The JavaScript function does exactly this job. It fetches the required data and send it back to me.