本文整理匯總了Java中org.apache.wicket.markup.html.form.TextField.add方法的典型用法代碼示例。如果您正苦於以下問題:Java TextField.add方法的具體用法?Java TextField.add怎麽用?Java TextField.add使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.wicket.markup.html.form.TextField
的用法示例。
在下文中一共展示了TextField.add方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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);
}
示例2: buildEventTypeAliasInput
import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
private void buildEventTypeAliasInput() {
final TextField<String> eventTypeAliasInput = new TextField<String>("eventTypeAliasInput", new PropertyModel<String>(this, "alias"));
eventTypeAliasInput.setOutputMarkupId(true);
final OnChangeAjaxBehavior onChangeAjaxBehavior = new OnChangeAjaxBehavior() {
private static final long serialVersionUID = -1427433442511094442L;
@Override
protected void onUpdate(final AjaxRequestTarget target) {
// TODO: make sure that alias does not already exist somewhere
EventTypeAliasPanel.this.element.setAlias(EventTypeAliasPanel.this.alias);
target.add(EventTypeAliasPanel.this.panel.getAttributeTreePanel().getAttributeTreeTable());
}
};
eventTypeAliasInput.add(onChangeAjaxBehavior);
this.layoutForm.add(eventTypeAliasInput);
}
示例3: 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);
}
示例4: 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;
}
示例5: addTextField
import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
private TextField<String> addTextField(String id, String attributeName, AbstractValidator<String> validator) {
TextField<String> tf = new TextField<String>(id, new PropertyModel<String>(this, attributeName), String.class);
this.form.add(tf);
if (validator != null) {
tf.add(validator);
}
return tf;
}
示例6: onInitialize
import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
@Override
protected void onInitialize() {
super.onInitialize();
Label label = new Label("label", this.name);
this.add(label);
TextField<String> field = new TextField<>("field", new PropertyModel<>(this.fields, this.name));
field.setLabel(Model.of(name));
field.add(StringValidator.maximumLength(255));
TextFeedbackPanel feedback = new TextFeedbackPanel("feedback", field);
this.add(field);
this.add(feedback);
}
示例7: addCategoryTextField
import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
private void addCategoryTextField() {
final TextField<String> categoryTextField = new TextField<String>("categoryTextField", new Model<String>());
categoryTextField.setOutputMarkupId(true);
categoryTextField.add(new AjaxFormComponentUpdatingBehavior("onchange") {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(final AjaxRequestTarget target) {
category = categoryTextField.getModelObject();
}
});
layoutForm.add(categoryTextField);
}
示例8: onInitialize
import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
@Override
protected void onInitialize() {
super.onInitialize();
Label label = new Label("label", this.name);
this.add(label);
TextField<Character> field = new TextField<>("field", new PropertyModel<>(this.fields, this.name), Character.class);
field.add(AttributeModifier.replace("maxlength", "1"));
field.setType(Character.class);
field.setLabel(Model.of(name));
TextFeedbackPanel feedback = new TextFeedbackPanel("feedback", field);
this.add(field);
this.add(feedback);
}
示例9: onInitialize
import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
@Override
protected void onInitialize() {
super.onInitialize();
Label label = new Label("label", this.name);
this.add(label);
TextField<Long> field = new TextField<>("field", new PropertyModel<>(this.fields, this.name));
field.setLabel(Model.of(name));
field.setType(Long.class);
field.add(RangeValidator.range(Long.MIN_VALUE, Long.MAX_VALUE));
TextFeedbackPanel feedback = new TextFeedbackPanel("feedback", field);
this.add(field);
this.add(feedback);
}
示例10: initLayout
import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
private void initLayout(final IModel<T> value, final List<PrismReferenceValue> values,
final boolean required, Collection<Class<? extends O>> types) {
WebMarkupContainer textWrapper = new WebMarkupContainer(ID_TEXT_WRAPPER);
textWrapper.setOutputMarkupId(true);
TextField<String> text = new TextField<String>(ID_TEXT, createTextModel(value));
text.add(new AjaxFormComponentUpdatingBehavior("blur") {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(AjaxRequestTarget ajaxRequestTarget) {
}
});
text.setRequired(required);
text.setEnabled(false);
textWrapper.add(text);
FeedbackPanel feedback = new FeedbackPanel(ID_FEEDBACK, new ComponentFeedbackMessageFilter(text));
textWrapper.add(feedback);
AjaxLink<String> edit = new AjaxLink<String>(ID_EDIT) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
editValuePerformed(values, target);
}
};
textWrapper.add(edit);
add(textWrapper);
initButtons();
}
示例11: createText
import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
protected TextField createText(IModel<String> model, IModel<String> label, boolean required) {
TextField text = new TextField(ID_TEXT, model);
text.setRequired(required);
text.add(AttributeAppender.replace("placeholder", label));
return text;
}
示例12: newHoursTextField
import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
@Override
protected TextField<Integer> newHoursTextField(final String id, IModel<Integer> model, Class<Integer> type) {
TextField<Integer> textField = super.newHoursTextField(id, model, type);
textField.add(new EmptyOnChangeAjaxFormUpdatingBehavior() {
@Override
protected void onUpdate(AjaxRequestTarget target){
DateInput.this.setModelObject(computeDateTime());
}
});
return textField;
}
示例13: createInputPanel
import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
protected InputPanel createInputPanel(String componentId, final IModel<T> model) {
TextPanel<?> textPanel = new TextPanel<String>(componentId, new PropertyModel<>(model, getPropertyExpression()));
TextField<?> textField = (TextField<?>) textPanel.getBaseFormComponent(); // UGLY HACK
textField.add(new AjaxFormComponentUpdatingBehavior("blur") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
onBlur(target, model);
}
});
return textPanel;
}
示例14: addNameTextField
import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
private void addNameTextField() {
final TextField<String> nameTextField = new TextField<String>("nameTextField", new Model<String>());
nameTextField.setOutputMarkupId(true);
nameTextField.add(new AjaxFormComponentUpdatingBehavior("onchange") {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(final AjaxRequestTarget target) {
name = nameTextField.getModelObject();
}
});
layoutForm.add(nameTextField);
}
示例15: newUsernameTextField
import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
/**
*
* @return
*/
private TextField<String> newUsernameTextField() {
TextField<String> usernameField = new TextField<>("adapterUsername", new PropertyModel<String>(adapterSettings, "adapterUsername"));
usernameField.add(new PopoverBehavior(Model.of(""), new StringResourceModel("step7.username.popover.text", this, null), getPopoverConfig(false)));
usernameField.setRequired(false);
return usernameField;
}