本文整理汇总了Java中org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteSettings.setShowListOnEmptyInput方法的典型用法代码示例。如果您正苦于以下问题:Java AutoCompleteSettings.setShowListOnEmptyInput方法的具体用法?Java AutoCompleteSettings.setShowListOnEmptyInput怎么用?Java AutoCompleteSettings.setShowListOnEmptyInput使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteSettings
的用法示例。
在下文中一共展示了AutoCompleteSettings.setShowListOnEmptyInput方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initTextField
import org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteSettings; //导入方法依赖的package包/类
private TextField initTextField() {
// IModel data = new PropertyModel(getModel(), SearchValue.F_VALUE);
if (lookup == null) {
return new TextField(ID_TEXT_INPUT, new PropertyModel(getModel(), SearchValue.F_VALUE));
}
LookupPropertyModel<String> lookupPropertyModel = new LookupPropertyModel<String>(getModel(), SearchValue.F_VALUE, lookup.asObjectable()) {
private static final long serialVersionUID = 1L;
@Override
public boolean isSupportsDisplayName() {
return true;
}
};
AutoCompleteSettings settings = new AutoCompleteSettings();
settings.setShowListOnEmptyInput(true);
return new AutoCompleteTextField<String>(ID_TEXT_INPUT, lookupPropertyModel, settings) {
private static final long serialVersionUID = 1L;
@Override
protected Iterator<String> getChoices(String input) {
return prepareAutoCompleteList(input).iterator();
}
};
}
示例2: createAutoCompleteSettings
import org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteSettings; //导入方法依赖的package包/类
protected AutoCompleteSettings createAutoCompleteSettings() {
AutoCompleteSettings autoCompleteSettings = new AutoCompleteSettings();
autoCompleteSettings.setShowListOnEmptyInput(true);
autoCompleteSettings.setShowListOnFocusGain(true);
autoCompleteSettings.setMaxHeightInPx(200);
autoCompleteSettings.setShowCompleteListOnFocusGain(true);
return autoCompleteSettings;
}
示例3: initTextField
import org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteSettings; //导入方法依赖的package包/类
private TextField initTextField() {
// IModel data = new PropertyModel(getModel(), SearchValue.F_VALUE);
if (lookup == null) {
return new TextField(ID_TEXT_INPUT, new PropertyModel(getModel(), SearchValue.F_VALUE));
}
LookupPropertyModel<String> lookupPropertyModel = new LookupPropertyModel<String>(getModel(), SearchValue.F_VALUE, lookup.asObjectable()) {
private static final long serialVersionUID = 1L;
@Override
public boolean isSupportsDisplayName() {
return true;
}
};
AutoCompleteSettings settings = new AutoCompleteSettings();
settings.setShowListOnEmptyInput(true);
return new AutoCompleteTextField<String>(ID_TEXT_INPUT, lookupPropertyModel, settings) {
private static final long serialVersionUID = 1L;
@Override
protected Iterator<String> getChoices(String input) {
return prepareAutoCompleteList(input).iterator();
}
};
}
示例4: AjaxTextFieldPanel
import org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteSettings; //导入方法依赖的package包/类
public AjaxTextFieldPanel(
final String id, final String name, final IModel<String> model, final boolean enableOnChange) {
super(id, name, model);
questionMarkJexlHelp = Constants.getJEXLPopover(this, TooltipConfig.Placement.right);
add(questionMarkJexlHelp.setVisible(false));
final AutoCompleteSettings settings = new AutoCompleteSettings();
settings.setShowCompleteListOnFocusGain(true);
settings.setShowListOnEmptyInput(true);
settings.setCssClassName("custom-autocomplete-box");
field = new AutoCompleteTextField<String>("textField", model, settings) {
private static final long serialVersionUID = -6648767303091874219L;
@Override
protected Iterator<String> getChoices(final String input) {
return AjaxTextFieldPanel.this.getChoices(input);
}
@Override
protected AutoCompleteBehavior<String> newAutoCompleteBehavior(
final IAutoCompleteRenderer<String> renderer, final AutoCompleteSettings settings) {
return new IndicatorAutoCompleteBehavior<String>(renderer, settings) {
private static final long serialVersionUID = 1070808433195962931L;
@Override
protected Iterator<String> getChoices(final String input) {
return AjaxTextFieldPanel.this.getChoices(input);
}
};
}
};
add(field.setLabel(new ResourceModel(name, name)).setOutputMarkupId(true));
if (enableOnChange && !isReadOnly()) {
field.add(new IndicatorAjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
private static final long serialVersionUID = -1107858522700306810L;
@Override
protected void onUpdate(final AjaxRequestTarget target) {
// nothing to do
}
});
}
}