當前位置: 首頁>>代碼示例>>Java>>正文


Java TextField.add方法代碼示例

本文整理匯總了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);
}
 
開發者ID:openwide-java,項目名稱:owsi-core-parent,代碼行數:21,代碼來源:UserSearchPanel.java

示例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);
}
 
開發者ID:bptlab,項目名稱:Unicorn,代碼行數:19,代碼來源:EventTypeAliasPanel.java

示例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);
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:24,代碼來源:TextPopupPanel.java

示例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;
}
 
開發者ID:acdh-oeaw,項目名稱:vlo-curation,代碼行數:23,代碼來源:AllFacetValuesPanel.java

示例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;
}
 
開發者ID:openNaEF,項目名稱:openNaEF,代碼行數:9,代碼來源:VrfSearchPage.java

示例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);
}
 
開發者ID:PkayJava,項目名稱:MBaaS,代碼行數:13,代碼來源:StringPanel.java

示例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);
}
 
開發者ID:bptlab,項目名稱:Unicorn,代碼行數:14,代碼來源:UploadPanel.java

示例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);
}
 
開發者ID:PkayJava,項目名稱:MBaaS,代碼行數:14,代碼來源:CharacterPanel.java

示例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);
}
 
開發者ID:PkayJava,項目名稱:MBaaS,代碼行數:14,代碼來源:LongPanel.java

示例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();
  }
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:36,代碼來源:ValueChoosePanel.java

示例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;
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:8,代碼來源:TextFormGroup.java

示例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;
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:12,代碼來源:DateInput.java

示例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;
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:12,代碼來源:DirectlyEditablePropertyColumn.java

示例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);
}
 
開發者ID:bptlab,項目名稱:Unicorn,代碼行數:14,代碼來源:UploadPanel.java

示例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;
}
 
開發者ID:U-QASAR,項目名稱:u-qasar.platform,代碼行數:11,代碼來源:ProjectWizardPanel.java


注:本文中的org.apache.wicket.markup.html.form.TextField.add方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。