Last active
December 17, 2015 15:58
-
-
Save edewit/5634935 to your computer and use it in GitHub Desktop.
Example of a login page with errai-security
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div data-field="root"> | |
<form> | |
<legend>Login</legend> | |
<div> | |
<label for="inputEmail">Username</label> | |
<div> | |
<input type="text" id="inputEmail" data-field="username"> | |
</div> | |
</div> | |
<div> | |
<label for="inputPassword">Password</label> | |
<div> | |
<input type="password" id="inputPassword" data-field="password"> | |
</div> | |
</div> | |
</form> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Page(role = LoginPage.class) | |
@Templated("#root") | |
@Dependent | |
public class LoginForm extends Composite { | |
@Inject | |
@Model | |
Identity identity; | |
@Inject | |
@Bound | |
@DataField | |
private TextBox username; | |
@Inject | |
@Bound | |
@DataField | |
private PasswordTextBox password; | |
@Inject | |
@DataField | |
private Anchor login; | |
@EventHandler("login") | |
private void loginClicked(ClickEvent event) { | |
identity.login(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment