本文整理汇总了Java中org.apache.wicket.markup.html.form.EmailTextField类的典型用法代码示例。如果您正苦于以下问题:Java EmailTextField类的具体用法?Java EmailTextField怎么用?Java EmailTextField使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EmailTextField类属于org.apache.wicket.markup.html.form包,在下文中一共展示了EmailTextField类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createBody
import org.apache.wicket.markup.html.form.EmailTextField; //导入依赖的package包/类
@Override
protected Component createBody(String wicketId) {
DelegatedMarkupPanel body = new DelegatedMarkupPanel(wicketId, AddUserPopupPanel.class);
addUserForm = new Form<User>("addUserForm", getModel());
body.add(addUserForm);
TextField<String> userName = new RequiredTextField<String>("userName", BindingModel.of(addUserForm.getModel(), Bindings.user().userName()));
userName.setLabel(new ResourceModel("widgets.modal.user.userName"));
addUserForm.add(userName);
TextField<String> firstName = new RequiredTextField<String>("firstName", BindingModel.of(addUserForm.getModel(), Bindings.user().firstName()));
firstName.setLabel(new ResourceModel("widgets.modal.user.firstName"));
addUserForm.add(firstName);
TextField<String> lastName = new RequiredTextField<String>("lastName", BindingModel.of(addUserForm.getModel(), Bindings.user().lastName()));
lastName.setLabel(new ResourceModel("widgets.modal.user.lastName"));
addUserForm.add(lastName);
EmailTextField email = new EmailTextField("email", BindingModel.of(addUserForm.getModel(), Bindings.user().email()));
email.setRequired(true);
email.setLabel(new ResourceModel("widgets.modal.user.email"));
addUserForm.add(email);
return body;
}
示例2: UserProfile
import org.apache.wicket.markup.html.form.EmailTextField; //导入依赖的package包/类
private Form<Void> UserProfile() {
final TextField name = new TextField("name", Model.of("Joe Blogs"));
final EmailTextField email = new EmailTextField("email", Model.of("[email protected]"));
Form<Void> form = new BootstrapForm<Void>("form");
form.add(new FormBehavior().type(FormType.Horizontal));
FormGroup formGroupInfo = new FormGroup("formGroupInfo", Model.of("Name"));
formGroupInfo.add(name);
formGroupInfo.add(email);
form.add(formGroupInfo);
FormGroup formGroupEmail = new FormGroup("formGroupEmail", Model.of("Email Address"));
formGroupEmail.add(email);
form.add(formGroupEmail);
FormGroup formGrouButton = new FormGroup("formGroupButton");
BootstrapButton submitButton = new BootstrapButton("submit-button", Buttons.Type.Default);
submitButton.setLabel(Model.of("Submit"));
formGrouButton.add(submitButton);
form.add(formGrouButton);
return form;
}
示例3: onInitialize
import org.apache.wicket.markup.html.form.EmailTextField; //导入依赖的package包/类
@Override
protected void onInitialize() {
super.onInitialize();
Form<Void> form = new StatelessForm<Void>("form"){
private EmailTextField email = new EmailTextField("email", Model.of(""));
private PasswordTextField password = new PasswordTextField("password", Model.of(""));
{
add(new BootstrapFeedbackPanel("feedbackError", FeedbackMessage.ERROR));
add(email.setRequired(true));
add(password);
}
protected void onSubmit() {
if(((WebApplication)getWebApplication()).authenticate(email.getModelObject(), password.getModelObject())){
continueToOriginalDestination();
throw new RestartResponseException(getApplication().getHomePage());
} else {
error(getString("login.invalid"));
}
}
};
add(form);
}
示例4: createStandardUserFields
import org.apache.wicket.markup.html.form.EmailTextField; //导入依赖的package包/类
protected final Component createStandardUserFields(String wicketId) {
DelegatedMarkupPanel standardFields = new DelegatedMarkupPanel(wicketId, "standardFields", AbstractUserPopup.class);
passwordField = new PasswordTextField("password", passwordModel);
confirmPasswordField = new PasswordTextField("confirmPassword", confirmPasswordModel);
boolean passwordRequired = securityManagementService.getOptions(typeDescriptor.getEntityClass()).isPasswordAdminUpdateEnabled()
&& !securityManagementService.getOptions(typeDescriptor.getEntityClass()).isPasswordUserRecoveryEnabled();
standardFields.add(
new RequiredTextField<String>("firstName", BindingModel.of(getModel(), Bindings.user().firstName()))
.setLabel(new ResourceModel("business.user.firstName")),
new RequiredTextField<String>("lastName", BindingModel.of(getModel(), Bindings.user().lastName()))
.setLabel(new ResourceModel("business.user.lastName")),
new RequiredTextField<String>("userName", BindingModel.of(getModel(), Bindings.user().userName()))
.setLabel(new ResourceModel("business.user.userName"))
.add(USERNAME_PATTERN_VALIDATOR)
.add(new UsernameUnicityValidator(getModel())),
new EnclosureContainer("addContainer")
.condition(Condition.predicate(Model.of(mode), equalTo(FormPanelMode.ADD)))
.add(
new EnclosureContainer("passwordContainer")
.condition(Condition.predicate(Model.of(securityManagementService.getOptions(typeDescriptor.getEntityClass()).isPasswordAdminUpdateEnabled()), isTrue()))
.add(
passwordField
.setLabel(new ResourceModel("business.user.password"))
.setRequired(passwordRequired)
.add(
new UserPasswordValidator(typeDescriptor)
.userModel(getModel())
),
new CoreLabel("passwordHelp",
new ResourceModel(
typeDescriptor.securityTypeDescriptor().resourceKeyGenerator().resourceKey("password.help"),
new ResourceModel(UserTypeDescriptor.USER.securityTypeDescriptor().resourceKeyGenerator().resourceKey("password.help"))
)
),
confirmPasswordField
.setLabel(new ResourceModel("business.user.confirmPassword"))
.setRequired(passwordRequired)
),
new CheckBox("active", BindingModel.of(getModel(), Bindings.user().active()))
.setLabel(new ResourceModel("business.user.active"))
),
new EmailTextField("email", BindingModel.of(getModel(), Bindings.user().email()))
.setLabel(new ResourceModel("business.user.email"))
.add(EmailAddressValidator.getInstance())
.add(new EmailUnicityValidator(getModel())),
new LocaleDropDownChoice("locale", BindingModel.of(getModel(), Bindings.user().locale()))
.setWidth(DropDownChoiceWidth.AUTO)
.setNullValid(true)
.setLabel(new ResourceModel("business.user.locale"))
);
return standardFields;
}
示例5: createBody
import org.apache.wicket.markup.html.form.EmailTextField; //导入依赖的package包/类
@Override
protected Component createBody(String wicketId) {
DelegatedMarkupPanel body = new DelegatedMarkupPanel(wicketId, UserFormPopupPanel.class);
userForm = new Form<User>("form", getModel());
body.add(userForm);
TextField<String> emailField = new EmailTextField("email", BindingModel.of(userForm.getModel(),
Binding.user().email())) {
private static final long serialVersionUID = 1L;
@Override
protected void onConfigure() {
super.onConfigure();
setVisible(UserFormPopupPanel.this.isAddMode());
}
};
emailField.setLabel(new ResourceModel("administration.user.field.email"));
emailField.setRequired(isAddMode());
userForm.add(emailField);
TextField<String> fullNameField = new TextField<String>("fullName", BindingModel.of(userForm.getModel(),
Binding.user().fullName()));
fullNameField.setLabel(new ResourceModel("administration.user.field.fullName"));
userForm.add(fullNameField);
WebMarkupContainer passwordContainer = new WebMarkupContainer("passwordContainer") {
private static final long serialVersionUID = 2727669661139358058L;
@Override
protected void onConfigure() {
super.onConfigure();
setVisible(UserFormPopupPanel.this.isAddMode());
}
};
userForm.add(passwordContainer);
CheckBox activeField = new CheckBox("active", BindingModel.of(userForm.getModel(), Binding.user().active()));
activeField.setLabel(new ResourceModel("administration.user.field.active"));
passwordContainer.add(activeField);
newPasswordField = new PasswordTextField("newPassword", Model.of(""));
newPasswordField.setLabel(new ResourceModel("administration.user.field.password"));
newPasswordField.setRequired(true);
passwordContainer.add(newPasswordField);
confirmPasswordField = new PasswordTextField("confirmPassword", Model.of(""));
confirmPasswordField.setLabel(new ResourceModel("administration.user.field.confirmPassword"));
confirmPasswordField.setRequired(true);
passwordContainer.add(confirmPasswordField);
LocaleDropDownChoice localeField = new LocaleDropDownChoice("locale", BindingModel.of(userForm.getModel(), Binding.user().locale()));
localeField.setLabel(new ResourceModel("administration.user.field.locale"));
userForm.add(localeField);
return body;
}