All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.webforj.component.login.event.LoginSubmitEvent Maven / Gradle / Ivy

Go to download

The Login component provides a form for user authentication using a username and password. It's designed to work with password managers, supports internationalization, and is responsive across various device sizes.

The newest version!
package com.webforj.component.login.event;

import com.webforj.component.element.annotation.EventName;
import com.webforj.component.element.annotation.EventOptions;
import com.webforj.component.element.annotation.EventOptions.EventData;
import com.webforj.component.event.ComponentEvent;
import com.webforj.component.login.Login;
import java.util.Map;

/**
 * Emitted when the login form is submitted.
 *
 * @author Hyyan Abo Fakher
 * @since 23.06
 */
@EventName("dwc-login-submit")
@EventOptions(data = {@EventData(key = "username", exp = "event.detail.username"),
    @EventData(key = "password", exp = "event.detail.password"),
    @EventData(key = "rememberme", exp = "event.detail.rememberme")})
public class LoginSubmitEvent extends ComponentEvent {

  /**
   * Creates an submit event.
   *
   * @param login the login component
   * @param eventMap the event map
   */
  public LoginSubmitEvent(Login login, Map eventMap) {
    super(login, eventMap);
  }

  /**
   * Gets the username submitted.
   *
   * @return the username
   */
  public String getUsername() {
    return (String) getData().get("username");
  }

  /**
   * Gets the password submitted.
   *
   * @return the password
   */
  public String getPassword() {
    return (String) getData().get("password");
  }

  /**
   * Gets the remember me submitted.
   *
   * @return the remember me
   */
  public boolean isRememberMe() {
    return (boolean) getData().get("rememberme");
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy