本文整理匯總了Java中org.apache.wicket.markup.html.form.TextField類的典型用法代碼示例。如果您正苦於以下問題:Java TextField類的具體用法?Java TextField怎麽用?Java TextField使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
TextField類屬於org.apache.wicket.markup.html.form包,在下文中一共展示了TextField類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onInitialize
import org.apache.wicket.markup.html.form.TextField; //導入依賴的package包/類
@Override
protected void onInitialize() {
super.onInitialize();
input = new TextField<Number>("input", Model.of(getModelObject()));
input.setType(getPropertyDescriptor().getPropertyClass());
add(input);
add(new AttributeAppender("class", new LoadableDetachableModel<String>() {
@Override
protected String load() {
if (hasErrors(true))
return " has-error";
else
return "";
}
}));
}
示例2: addUrlForm
import org.apache.wicket.markup.html.form.TextField; //導入依賴的package包/類
private void addUrlForm() {
urlForm = new Form<SeedUrl>("urlForm", CompoundPropertyModel.of(Model
.of(new SeedUrl())));
urlForm.setOutputMarkupId(true);
urlForm.add(new TextField<String>("url"));
urlForm.add(new AjaxSubmitLink("addUrl", urlForm) {
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
addSeedUrl();
urlForm.setModelObject(new SeedUrl());
target.add(urlForm);
target.add(seedUrlsTable);
}
});
add(urlForm);
}
示例3: buildMainLayout
import org.apache.wicket.markup.html.form.TextField; //導入依賴的package包/類
private void buildMainLayout() {
this.loginForm = new WarnOnExitForm("loginForm");
this.emailInput = new TextField<String>("emailInput", Model.of(""));
this.loginForm.add(this.emailInput);
this.passwordInput = new PasswordTextField("passwordInput", Model.of(""));
this.loginForm.add(this.passwordInput);
this.addLoginButton();
this.addRegisterLink();
this.add(this.loginForm);
this.logoutForm = new Form<Object>("logoutForm");
this.addLogoutButton();
this.add(this.logoutForm);
if (((AuthenticatedSession) Session.get()).getUser() != null) {
this.loginForm.setVisible(false);
} else {
this.logoutForm.setVisible(false);
}
}
示例4: UserSearchPanel
import org.apache.wicket.markup.html.form.TextField; //導入依賴的package包/類
public UserSearchPanel(String id, IPageable pageable, AbstractUserDataProvider<User> dataProvider) {
super(id);
// Quick search
add(new UserQuickSearchComponent("userQuickSearch"));
// Search form
Form<Void> form = new PageableSearchForm<Void>("form", pageable);
TextField<String> searchInput = new TextField<String>("searchInput", dataProvider.getNameModel());
searchInput.setLabel(new ResourceModel("user.portfolio.search.name"));
searchInput.add(new LabelPlaceholderBehavior());
form.add(searchInput);
CheckBox active = new CheckBox("includeInactive", dataProvider.getIncludeInactivesModel());
active.setLabel(new ResourceModel("user.portfolio.search.includeInactive"));
form.add(active);
add(form);
}
示例5: SettingsPage
import org.apache.wicket.markup.html.form.TextField; //導入依賴的package包/類
public SettingsPage() {
settingsTable = new WebMarkupContainer("settingsTable");
settingsTable.setOutputMarkupId(true);
RefreshingView<NutchConfig> nutchConfig = new RefreshingView<NutchConfig>(
"settings") {
@Override
protected Iterator<IModel<NutchConfig>> getItemModels() {
return new CpmIteratorAdapter<NutchConfig>(
convertNutchConfig(nutchService.getNutchConfig(getCurrentInstance()
.getId())));
}
@Override
protected void populateItem(Item<NutchConfig> item) {
item.add(new Label("name"));
item.add(new TextField<String>("value"));
}
};
settingsTable.add(nutchConfig);
add(settingsTable);
}
示例6: doInitialize
import org.apache.wicket.markup.html.form.TextField; //導入依賴的package包/類
@Override
protected void doInitialize(Border layout) {
add(layout);
this.form = new Form<>("form");
layout.add(this.form);
this.nameField = new TextField<>("nameField", new PropertyModel<>(this, "name"));
this.nameField.add(new CollectionNameValidator());
this.nameField.setRequired(true);
this.form.add(this.nameField);
this.nameFeedback = new TextFeedbackPanel("nameFeedback", this.nameField);
this.form.add(this.nameFeedback);
this.closeButton = new BookmarkablePageLink<>("closeButton", CollectionBrowsePage.class);
this.form.add(this.closeButton);
this.saveButton = new Button("saveButton");
this.saveButton.setOnSubmit(this::saveButtonOnSubmit);
this.form.add(this.saveButton);
}
示例7: initLayout
import org.apache.wicket.markup.html.form.TextField; //導入依賴的package包/類
private void initLayout() {
final TextField input = initTextField();
input.add(new AjaxFormComponentUpdatingBehavior("blur") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
//nothing to do, just update model data
}
});
input.add(new Behavior() {
@Override
public void bind(Component component) {
super.bind(component);
component.add(AttributeModifier.replace("onkeydown",
Model.of("if(event.keyCode == 13) {event.preventDefault();}")));
}
});
input.setOutputMarkupId(true);
add(input);
}
示例8: TextDetailsPanel
import org.apache.wicket.markup.html.form.TextField; //導入依賴的package包/類
public TextDetailsPanel(String id, IModel<T> model, Class clazz){
super(id);
final TextField<T> text = new TextField<>(ID_INPUT, model);
text.setType(clazz);
add(text);
Label details = new Label(ID_DETAILS);
details.add(AttributeModifier.replace("title", new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
return createAssociationTooltip();
}
}));
details.add(new InfoTooltipBehavior(){
@Override
public String getDataPlacement(){
return "bottom";
}
});
add(details);
}
示例9: createOptionsForm
import org.apache.wicket.markup.html.form.TextField; //導入依賴的package包/類
private Form createOptionsForm(String id) {
final Form options = new AjaxIndicatingForm(id);
final DropDownChoice<SortParam<FieldValuesOrder>> sortSelect
= new FieldValueOrderSelector("sort", new PropertyModel<SortParam<FieldValuesOrder>>(valuesProvider, "sort"));
sortSelect.add(new UpdateOptionsFormBehavior(options));
options.add(sortSelect);
final TextField filterField = new TextField<>("filter", new PropertyModel(filterModel, "name"));
filterField.add(new AjaxFormComponentUpdatingBehavior("keyup") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
target.add(valuesContainer);
}
});
options.add(filterField);
addOccurenceOptions(options);
return options;
}
示例10: createFilterForm
import org.apache.wicket.markup.html.form.TextField; //導入依賴的package包/類
/**
* Creates a form with an input bound to the filter model
*
* @param id component id
* @return filter form
*/
private Form createFilterForm(String id) {
final Form filterForm = new Form(id);
final TextField<String> filterField = new TextField<>("filterText",
new PropertyModel<String>(filterModel, "name"));
// make field update
filterField.add(new AjaxFormComponentUpdatingBehavior("keyup") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
//update values
target.add(valuesContainer);
}
});
filterForm.add(filterField);
return filterForm;
}
示例11: BookmarkLinkPanel
import org.apache.wicket.markup.html.form.TextField; //導入依賴的package包/類
public BookmarkLinkPanel(String id, IModel<String> linkModel, IModel<String> pageTitleModel) {
super(id);
this.linkModel = linkModel;
this.pageTitleModel = pageTitleModel;
add(new ExternalLink("link", linkModel)
.add(new Label("linkText", pageTitleModel)));
add(new TextField("linkInput", linkModel));
add(new WebMarkupContainer("bookmarkInstructions") {
@Override
protected void onConfigure() {
setVisible(bookmarkMode);
}
});
add(new WebMarkupContainer("copyInstructions") {
@Override
protected void onConfigure() {
setVisible(copyMode);
}
});
}
示例12: testLoadDraft
import org.apache.wicket.markup.html.form.TextField; //導入依賴的package包/類
@WithUserDetails("vinicius.nunes")
@Test
public void testLoadDraft() {
tester = new SingularWicketTester(singularApplication);
FormPage p = saveDraft();
RequirementInstance requirement = getRequirementFrom(p);
ActionContext context = new ActionContext();
context.setFormName(SPackageFOO.STypeFOO.FULL_NAME);
context.setFormAction(FormAction.FORM_FILL);
context.setRequirementId(requirement.getCod());
FormPage p2 = new FormPage(context);
tester.startPage(p2);
tester.assertRenderedPage(FormPage.class);
TextField<String> t2 = (TextField<String>) new AssertionsWComponent(p2).getSubComponents(TextField.class).first().getTarget();
assertEquals(SUPER_TESTE_STRING, t2.getDefaultModelObject());
}
示例13: ProbabilityEntryPanel
import org.apache.wicket.markup.html.form.TextField; //導入依賴的package包/類
public ProbabilityEntryPanel(final String id, final int entryId, final SimulationTreeTableProvider<Object> simulationTreeTableProvider) {
super(id);
final Form<Void> form = new Form<Void>("form");
this.textField = new TextField<String>("textFieldID", Model.of(simulationTreeTableProvider.getProbabilityForEntry(entryId)));
this.textField.setOutputMarkupPlaceholderTag(true);
this.textField.setOutputMarkupId(true);
this.textField.add(new AjaxFormComponentUpdatingBehavior("onchange") {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(final AjaxRequestTarget target) {
simulationTreeTableProvider.setProbabilityForEntry(ProbabilityEntryPanel.this.textField.getValue(), entryId);
}
});
form.add(this.textField);
this.add(form);
}
示例14: buildTextFields
import org.apache.wicket.markup.html.form.TextField; //導入依賴的package包/類
private void buildTextFields() {
this.transformationRuleNameTextField = new TextField<String>("transformationRuleNameTextField", new PropertyModel<String>(this, "transformationRuleName"));
this.transformationRuleNameTextField.setOutputMarkupId(true);
this.layoutForm.add(this.transformationRuleNameTextField);
final List<String> eventTypes = EapEventType.getAllTypeNames();
this.eventTypeDropDownChoice = new DropDownChoice<String>("eventTypeDropDownChoice", new PropertyModel<String>(this, "selectedEventTypeName"), eventTypes);
this.eventTypeDropDownChoice.add(new AjaxFormComponentUpdatingBehavior("onchange") {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(final AjaxRequestTarget target) {
BasicTransformationRuleEditorPanel.this.updateOnChangeOfDropDownChoice(target);
}
});
this.layoutForm.add(this.eventTypeDropDownChoice);
this.transformationRuleTextArea = new TextArea<String>("transformationRuleTextArea", new PropertyModel<String>(this, "transformationRule"));
this.transformationRuleTextArea.setOutputMarkupId(true);
this.layoutForm.add(this.transformationRuleTextArea);
}
示例15: RepeatPatternOperatorRangePanel
import org.apache.wicket.markup.html.form.TextField; //導入依賴的package包/類
public RepeatPatternOperatorRangePanel(final String id, final PatternOperatorElement element, final AdvancedTransformationRuleEditorPanel panel) {
super(id);
this.layoutForm = new Form<Void>("layoutForm");
final RangeElement rangeElement = element.getRangeElement();
this.matchCount = rangeElement.getLeftEndpoint();
this.matchCountInput = new TextField<Integer>("matchCountInput", new PropertyModel<Integer>(this, "matchCount"));
final OnChangeAjaxBehavior onChangeAjaxBehavior = new OnChangeAjaxBehavior() {
private static final long serialVersionUID = 2251803290291534439L;
@Override
protected void onUpdate(final AjaxRequestTarget target) {
rangeElement.setLeftEndpoint(RepeatPatternOperatorRangePanel.this.matchCount);
target.add(panel.getAttributeTreePanel().getAttributeTreeTable());
}
};
this.matchCountInput.add(onChangeAjaxBehavior);
this.matchCountInput.setOutputMarkupId(true);
this.layoutForm.add(this.matchCountInput);
this.add(this.layoutForm);
}