Skip to content

Commit c5e91b3

Browse files
committed
As I user I could tick check box when I want to be auto-logged in the future.
1 parent d787a98 commit c5e91b3

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

src/main/java/pl/tomaszdziurko/wicket/view/LoginPage.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ <h1>Login Page</h1>
3131
<input type="password" id="password" wicket:id="password" />
3232
</div>
3333
</div>
34+
<div class="control-group">
35+
<div class="controls">
36+
<label class="checkbox">
37+
<input type="checkbox" wicket:id="rememberMe"> Remember me on this computer
38+
</label>
39+
</div>
40+
</div>
3441
<div class="form-actions">
3542
<input type="submit" wicket:id="submit" value="Login" title="Login" class="btn btn-primary"/>
3643
</div>

src/main/java/pl/tomaszdziurko/wicket/view/LoginPage.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package pl.tomaszdziurko.wicket.view;
22

33
import org.apache.wicket.markup.html.form.Button;
4+
import org.apache.wicket.markup.html.form.CheckBox;
45
import org.apache.wicket.markup.html.form.Form;
56
import org.apache.wicket.markup.html.form.PasswordTextField;
67
import org.apache.wicket.markup.html.form.RequiredTextField;
@@ -15,6 +16,7 @@ public class LoginPage extends BasePage {
1516

1617
private String login;
1718
private String password;
19+
private boolean rememberMe;
1820

1921
public LoginPage() {
2022

@@ -24,6 +26,7 @@ public LoginPage() {
2426
loginForm.add(new FeedbackPanel("feedback"));
2527
loginForm.add(new RequiredTextField<String>("login", new PropertyModel<String>(this, "login")));
2628
loginForm.add(new PasswordTextField("password", new PropertyModel<String>(this, "password")));
29+
loginForm.add(new CheckBox("rememberMe", new PropertyModel<Boolean>(this, "rememberMe")));
2730

2831
Button submit = new Button("submit") {
2932
@Override

0 commit comments

Comments
 (0)