webforj/webforj#1126
Action Property
Login now has action property. Sets the form submission URL.
login.setAction("/api/auth");
Custom Fields
Add extra fields to the login form. They're collected automatically and available in the submit event via event.getData().get("field-name").
TextField tenantField = new TextField();
tenantField.setAttribute("name", "tenant-id");
login.addToBeforeForm(tenantField);
login.onSubmit(event -> {
String tenantId = (String) event.getData().get("tenant-id");
});
Custom fields need a name attribute.
We need to update the https://docs.webforj.com/docs/components/login#custom-fields demo