Skip to content

document action prop and custom fields support in login component #600

@hyyan

Description

@hyyan

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions