当前位置: 首页>>代码示例>>Java>>正文


Java RequiredTextField类代码示例

本文整理汇总了Java中org.apache.wicket.markup.html.form.RequiredTextField的典型用法代码示例。如果您正苦于以下问题:Java RequiredTextField类的具体用法?Java RequiredTextField怎么用?Java RequiredTextField使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RequiredTextField类属于org.apache.wicket.markup.html.form包,在下文中一共展示了RequiredTextField类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createBody

import org.apache.wicket.markup.html.form.RequiredTextField; //导入依赖的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;
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:27,代码来源:AddUserPopupPanel.java

示例2: onInitialize

import org.apache.wicket.markup.html.form.RequiredTextField; //导入依赖的package包/类
@Override
protected void onInitialize() {
	add(new RequiredTextField<String>("name").setLabel(Model.of(getString("165"))));
	add(new TextField<String>("iconUrl").setLabel(Model.of(getString("1575"))));
	add(new RequiredTextField<String>("clientId").setLabel(Model.of(getString("1576"))));
	add(new RequiredTextField<String>("clientSecret").setLabel(Model.of(getString("1577"))));
	add(redirectUriText = (TextField<String>) new TextField<>("redirectUri", Model.of("")).setLabel(Model.of(getString("1587"))));
	add(new RequiredTextField<String>("requestKeyUrl").setLabel(Model.of(getString("1578"))));
	add(new RequiredTextField<String>("requestTokenUrl").setLabel(Model.of(getString("1579"))));
	add(new RequiredTextField<String>("requestTokenAttributes").setLabel(Model.of(getString("1586"))));
	add(new RequiredTextField<String>("requestInfoUrl").setLabel(Model.of(getString("1580"))));
	add(new RequiredTextField<String>("loginParamName").setLabel(Model.of(getString("1582"))));
	add(new RequiredTextField<String>("emailParamName").setLabel(Model.of(getString("1583"))));
	add(new TextField<String>("firstnameParamName").setLabel(Model.of(getString("1584"))));
	add(new TextField<String>("lastnameParamName").setLabel(Model.of(getString("1585"))));
	super.onInitialize();
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:18,代码来源:OAuthForm.java

示例3: GeneralSettingsPanel

import org.apache.wicket.markup.html.form.RequiredTextField; //导入依赖的package包/类
public GeneralSettingsPanel(String id) {
    super(id);
    add(new CssClass("general-settings-panel"));

    add(new TextField("serverName"));

    WebApplicationAddon applicationAddon = addonsManager.addonByType(WebApplicationAddon.class);

    add(applicationAddon.getUrlBaseLabel("urlBaseLabel"));
    add(applicationAddon.getUrlBaseTextField("urlBase"));
    RequiredTextField<Integer> uploadSizeField = new RequiredTextField<>("fileUploadMaxSizeMb");
    uploadSizeField.add(new RangeValidator<>(0, Integer.MAX_VALUE));
    add(uploadSizeField);
    RequiredTextField<String> dateFormatField = new RequiredTextField<>("dateFormat");
    dateFormatField.add(new DateFormatValidator());
    add(dateFormatField);
    add(new StyledCheckbox("offlineMode"));
    add(new SchemaHelpBubble("serverName.help"));
    add(applicationAddon.getUrlBaseHelpBubble("urlBase.help"));
    add(new SchemaHelpBubble("fileUploadMaxSizeMb.help"));
    add(new SchemaHelpBubble("dateFormat.help"));
    add(new SchemaHelpBubble("offlineMode.help"));
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:24,代码来源:GeneralSettingsPanel.java

示例4: EditForm

import org.apache.wicket.markup.html.form.RequiredTextField; //导入依赖的package包/类
public EditForm(String id, final IModel<Setting> setting) {
	super(id, new CompoundPropertyModel<Setting>(setting));
	add(new LocalFeedbackPanel("feedback", this));
	value = new RequiredTextField<String>("value");
	value.add(new SettingValidator(setting.getObject().getName()));
	add(value);
	add(new Button("save") {
		private static final long serialVersionUID = 1L;

		@Override
		public void onSubmit() {
			if (!value.hasErrorMessage()) {
				BlogServiceHolder.get().updateSetting(EditForm.this.getModelObject());
				getSession().info("Setting saved");
				setRedirect(true);
				setResponsePage(SettingsPage.class);
			}
		}
	});
	add(new CancelButton("cancel", SettingsPage.class));
}
 
开发者ID:rla,项目名称:old-blog,代码行数:22,代码来源:SettingEditPage.java

示例5: InsertContact

import org.apache.wicket.markup.html.form.RequiredTextField; //导入依赖的package包/类
public InsertContact() {
    add(new FeedbackPanel("feedback"));

    insertForm = new Form<Contact>("insertForm") {

        @Override
        protected void onSubmit() {
            contactDao.addContact(name, email);
            setResponsePage(ListContacts.class);
        }
    };

    insertForm.add(new RequiredTextField<String>("name",
            new PropertyModel<String>(this, "name")));
    insertForm.add(new RequiredTextField<String>("email", new PropertyModel<String>(this,
            "email")));
    add(insertForm);
}
 
开发者ID:red-fox-mulder,项目名称:eap-6.1-quickstarts,代码行数:19,代码来源:InsertContact.java

示例6: InsertContact

import org.apache.wicket.markup.html.form.RequiredTextField; //导入依赖的package包/类
public InsertContact() {
    add(new FeedbackPanel("feedback"));

    insertForm = new Form<Contact>("insertForm") {

        @Override
        protected void onSubmit() {
            contactDao.addContact(name, email);
            setResponsePage(ListContacts.class);
        }
    };

    insertForm.add(new RequiredTextField<String>("name", new PropertyModel<String>(this, "name")));
    insertForm.add(new RequiredTextField<String>("email", new PropertyModel<String>(this, "email")));
    add(insertForm);
}
 
开发者ID:red-fox-mulder,项目名称:eap-6.1-quickstarts,代码行数:17,代码来源:InsertContact.java

示例7: createBody

import org.apache.wicket.markup.html.form.RequiredTextField; //导入依赖的package包/类
@Override
protected Component createBody(String wicketId) {
	DelegatedMarkupPanel body = new DelegatedMarkupPanel(wicketId, ProjectFormPopupPanel.class);
	
	form = new Form<Project>("form", getModel());
	form.add(
			new RequiredTextField<String>("name", BindingModel.of(getModel(), Binding.project().name()))
					.setLabel(new ResourceModel("project.field.name"))
					.add(new ProjectNamePatternValidator())
					.setEnabled(MavenArtifactNotifierSession.get().hasRoleAdmin()),
			new UrlTextField("websiteUrl", new ExternalLinkWrapperWrapModel(BindingModel.of(getModel(), Binding.project().additionalInformation().websiteUrl())))
					.setLabel(new ResourceModel("project.field.websiteUrl")),
			new UrlTextField("issueTrackerUrl", new ExternalLinkWrapperWrapModel(BindingModel.of(getModel(), Binding.project().additionalInformation().issueTrackerUrl())))
					.setLabel(new ResourceModel("project.field.issueTrackerUrl")),
			new UrlTextField("scmUrl", new ExternalLinkWrapperWrapModel(BindingModel.of(getModel(), Binding.project().additionalInformation().scmUrl())))
					.setLabel(new ResourceModel("project.field.scmUrl")),
			new UrlTextField("changelogUrl", new ExternalLinkWrapperWrapModel(BindingModel.of(getModel(), Binding.project().additionalInformation().changelogUrl())))
					.setLabel(new ResourceModel("project.field.changelogUrl")),
			new ProjectLicenseDropDownChoice("licenses", BindingModel.of(getModel(), Binding.project().additionalInformation().licenses()))
					.setLabel(new ResourceModel("project.field.licenses"))
	);
	body.add(form);
	
	return body;
}
 
开发者ID:openwide-java,项目名称:artifact-listener,代码行数:26,代码来源:ProjectFormPopupPanel.java

示例8: createBody

import org.apache.wicket.markup.html.form.RequiredTextField; //导入依赖的package包/类
@Override
protected Component createBody(String wicketId) {
	DelegatedMarkupPanel body = new DelegatedMarkupPanel(wicketId, ArtifactNotificationRuleFormPopupPanel.class);
	
	ruleForm = new Form<ArtifactNotificationRule>("form", getModel());
	body.add(ruleForm);
	
	TextField<String> regexField = new RequiredTextField<String>("regex", BindingModel.of(ruleForm.getModel(),
			Binding.artifactNotificationRule().regex()));
	regexField.setLabel(new ResourceModel("artifact.rules.field.regex"));
	ruleForm.add(regexField);
	
	ArtifactNotificationRuleTypeDropDownChoice typeField = new ArtifactNotificationRuleTypeDropDownChoice("type",
			BindingModel.of(ruleForm.getModel(), Binding.artifactNotificationRule().type()));
	typeField.setLabel(new ResourceModel("artifact.rules.field.type"));
	typeField.setRequired(true);
	ruleForm.add(typeField);
	
	return body;
}
 
开发者ID:openwide-java,项目名称:artifact-listener,代码行数:21,代码来源:ArtifactNotificationRuleFormPopupPanel.java

示例9: setupInputs

import org.apache.wicket.markup.html.form.RequiredTextField; //导入依赖的package包/类
private void setupInputs() {
	usernameWrapper = new WebMarkupContainer("user.detail.username.wrapper");
	passwordWrapper = new WebMarkupContainer("user.detail.password.wrapper");
	usernameWrapper.setOutputMarkupId(true);
	passwordWrapper.setOutputMarkupId(true);

	add(passwordWrapper);
	add(usernameWrapper);

	username = new RequiredTextField<>("user.username",
			new PropertyModel<String>(this, "_username"));
	password = new PasswordTextField("user.password",
			new PropertyModel<String>(this, "_password"));

	passwordWrapper.add(password);
	usernameWrapper.add(username);

	firstname = new TextField<>("user.firstname",
			new PropertyModel<String>(this, "_firstname"));
	lastname = new TextField<>("user.lastname", new PropertyModel<String>(
			this, "_lastname"));

	add(firstname);
	add(lastname);
}
 
开发者ID:atomfrede,项目名称:freezing-octo-bear,代码行数:26,代码来源:UserDetailForm.java

示例10: createStaticFormQuery

import org.apache.wicket.markup.html.form.RequiredTextField; //导入依赖的package包/类
private ObjectQuery createStaticFormQuery(Form form) {
	RequiredTextField<String> usernameTextFiled = (RequiredTextField) form
			.get(createComponentPath(ID_STATIC_LAYOUT, ID_USERNAME_CONTAINER, ID_USERNAME));
	RequiredTextField<String> emailTextField = (RequiredTextField) form
			.get(createComponentPath(ID_STATIC_LAYOUT, ID_EMAIL_CONTAINER, ID_EMAIL));
	String username = usernameTextFiled != null ? usernameTextFiled.getModelObject() : null;
	String email = emailTextField != null ? emailTextField.getModelObject() : null;
	LOGGER.debug("Reset Password user info form submitted. username={}, email={}", username, email);

	ResetPolicyDto resetPasswordPolicy = getResetPasswordPolicy();
	if (resetPasswordPolicy == null) {
		passwordResetNotSupported();
	}
	ResetMethod method = resetPasswordPolicy.getResetMethod();
	if (method == null) {
		passwordResetNotSupported();
	}
	
	switch (method) {
		case MAIL:
			return QueryBuilder.queryFor(UserType.class, getPrismContext()).item(UserType.F_EMAIL_ADDRESS)
					.eq(email).matchingCaseIgnore().build();

		case SECURITY_QUESTIONS:
			return QueryBuilder.queryFor(UserType.class, getPrismContext()).item(UserType.F_NAME)
					.eqPoly(username).matchingNorm().and().item(UserType.F_EMAIL_ADDRESS).eq(email)
					.matchingCaseIgnore().build();

		default:
			passwordResetNotSupported();
			return null; // not reached
	}

}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:35,代码来源:PageForgotPassword.java

示例11: CaptchaPanel

import org.apache.wicket.markup.html.form.RequiredTextField; //导入依赖的package包/类
/**
 * Constructor.
 *
 * @param id
 *            The component id
 */
public CaptchaPanel(String id) {
	super(id);

	FeedbackPanel feedback = new FeedbackPanel("feedback",
			new ContainerFeedbackMessageFilter(CaptchaPanel.this));
	add(feedback);

	captchaImageResource = createCaptchImageResource();
	final Image captchaImage = new Image("image", captchaImageResource);
	captchaImage.setOutputMarkupId(true);
	add(captchaImage);

	AjaxLink<Void> changeCaptchaLink = new AjaxLink<Void>("changeLink") {
				private static final long serialVersionUID = 1L;

		@Override
		public void onClick(AjaxRequestTarget target) {
			captchaImageResource.invalidate();
			target.add(captchaImage);
		}
	};
	add(changeCaptchaLink);

	add(new RequiredTextField<String>("text",
			new PropertyModel<String>(CaptchaPanel.this, "captchaText"), String.class) {
							private static final long serialVersionUID = 1L;

		@Override
		protected final void onComponentTag(final ComponentTag tag) {
			super.onComponentTag(tag);
			// clear the field after each render
			tag.put("value", "");
		}
	});
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:42,代码来源:CaptchaPanel.java

示例12: createBody

import org.apache.wicket.markup.html.form.RequiredTextField; //导入依赖的package包/类
@Override
protected Component createBody(String wicketId) {
	DelegatedMarkupPanel body = new DelegatedMarkupPanel(wicketId, UserGroupPopup.class);
	
	userGroupForm = new Form<UserGroup>("form", getModel());
	body.add(
			userGroupForm
					.add(
							new RequiredTextField<String>("name", BindingModel.of(userGroupForm.getModel(), Bindings.userGroup().name()))
									.setLabel(new ResourceModel("administration.usergroup.field.name")),
							new TextArea<String>("description", BindingModel.of(userGroupForm.getModel(), Bindings.userGroup().description()))
									.setLabel(new ResourceModel("administration.usergroup.field.description")),
							new CheckGroup<Authority>("authoritiesGroup",
									BindingModel.of(userGroupForm.getModel(), Bindings.userGroup().authorities()),
									Suppliers2.<Authority>hashSet()
							)
									.add(
											new SequenceView<Authority>("authorities", new RoleDataProvider()) {
												private static final long serialVersionUID = 1L;
												@Override
												protected void populateItem(Item<Authority> item) {
													item.add(
															new Check<Authority>("authorityCheck", item.getModel())
																	.setLabel(AuthorityRenderer.get().asModel(item.getModel()))
													);
												}
											}
									)
					)
	);
	
	return body;
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:34,代码来源:UserGroupPopup.java

示例13: ConsoleMaintenanceAuthenticationPage

import org.apache.wicket.markup.html.form.RequiredTextField; //导入依赖的package包/类
public ConsoleMaintenanceAuthenticationPage(PageParameters parameters) {
	super(parameters);
	
	addHeadPageTitleKey("console.maintenance.authentication");
	
	Form<Void> signInForm = new Form<Void>("signInForm") {
		private static final long serialVersionUID = 1L;
		
		@Override
		protected void onSubmit() {
			if (StringUtils.hasText(userNameField.getModelObject())) {
				U genericUser = genericUserService.getByUserName(userNameField.getModelObject());
				
				if (genericUser != null) {
					AbstractCoreSession.get().signInAs(userNameField.getModelObject());
					AbstractCoreSession.get().success(new StringResourceModel("console.authentication.success")
							.setParameters(userNameField.getModelObject()).getObject());
				} else {
					AbstractCoreSession.get().error(getString("signIn.error.unknown"));
				}
			} else {
				AbstractCoreSession.get().error(getString("signIn.error.unknown"));
			}
			throw LoginSuccessPage.linkDescriptor().newRestartResponseException();
		}
	};
	add(signInForm);
	
	userNameField = new RequiredTextField<String>("userName", Model.of(""));
	userNameField.setLabel(new ResourceModel("console.signIn.userName"));
	userNameField.add(new LabelPlaceholderBehavior());
	userNameField.setOutputMarkupId(true);
	signInForm.add(userNameField);
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:35,代码来源:ConsoleMaintenanceAuthenticationPage.java

示例14: onInitialize

import org.apache.wicket.markup.html.form.RequiredTextField; //导入依赖的package包/类
@Override
protected void onInitialize() {
	super.onInitialize();
	final boolean isGroupAdmin = hasGroupAdminLevel(getRights());
	userToadd.setEnabled(!isGroupAdmin);
	add(new RequiredTextField<String>("name").setLabel(Model.of(getString("165"))));
	add(logo);
	add(new TextField<String>("tag").setLabel(Model.of(getString("admin.group.form.tag"))));
	add(new CheckBox("restricted").setLabel(Model.of(getString("restricted.group.files"))));
	add(new AjaxCheckBox("limited") {
		private static final long serialVersionUID = 1L;

		@Override
		protected void onUpdate(AjaxRequestTarget target) {
			target.add(
				maxFilesSize.setEnabled(getModelObject())
				, maxRecordingsSize.setEnabled(getModelObject())
				, maxRooms.setEnabled(getModelObject())
				, recordingTtl.setEnabled(getModelObject())
				, reminderDays.setEnabled(getModelObject())
			);
		}
	}.setLabel(Model.of(getString("admin.group.form.limited"))));
	add(maxFilesSize.setLabel(Model.of(getString("admin.group.form.maxFilesSize"))).setEnabled(false).setOutputMarkupId(true));
	add(maxRecordingsSize.setLabel(Model.of(getString("admin.group.form.maxRecordingsSize"))).setEnabled(false).setOutputMarkupId(true));
	add(maxRooms.setLabel(Model.of(getString("admin.group.form.maxRooms"))).setEnabled(false).setOutputMarkupId(true));
	add(recordingTtl.setLabel(Model.of(getString("admin.group.form.recordingTtl"))).setEnabled(false).setOutputMarkupId(true));
	add(reminderDays.setLabel(Model.of(getString("admin.group.form.reminderDays"))).setEnabled(false).setOutputMarkupId(true));
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:30,代码来源:GroupForm.java

示例15: LabelsForm

import org.apache.wicket.markup.html.form.RequiredTextField; //导入依赖的package包/类
public LabelsForm(String id, LangPanel panel, StringLabel label) {
	super(id, new CompoundPropertyModel<>(label));
	this.panel = panel;
	key = label.getKey();
	value = label.getValue();

	add(new RequiredTextField<String>("key"));
	add(new TextArea<String>("value"));
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:10,代码来源:LabelsForm.java


注:本文中的org.apache.wicket.markup.html.form.RequiredTextField类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。