Search in sources :

Example 1 with AutoCompleterImpl

use of org.olat.core.gui.components.form.flexible.impl.elements.AutoCompleterImpl in project OpenOLAT by OpenOLAT.

the class FormUIFactory method addTextElementWithAutoCompleter.

public AutoCompleter addTextElementWithAutoCompleter(String id, String name, final String i18nLabel, final int maxLen, String initialValue, FormItemContainer formLayout) {
    String val = initialValue == null ? "" : initialValue;
    AutoCompleterImpl te = new AutoCompleterImpl(id, name);
    te.setNotLongerThanCheck(maxLen, "text.element.error.notlongerthan");
    setLabelIfNotNull(i18nLabel, te);
    te.setMaxLength(maxLen);
    te.setValue(val);
    formLayout.add(te);
    return te;
}
Also used : AutoCompleterImpl(org.olat.core.gui.components.form.flexible.impl.elements.AutoCompleterImpl)

Example 2 with AutoCompleterImpl

use of org.olat.core.gui.components.form.flexible.impl.elements.AutoCompleterImpl in project openolat by klemens.

the class FormUIFactory method addTextElementWithAutoCompleter.

public AutoCompleter addTextElementWithAutoCompleter(String id, String name, final String i18nLabel, final int maxLen, String initialValue, FormItemContainer formLayout) {
    String val = initialValue == null ? "" : initialValue;
    AutoCompleterImpl te = new AutoCompleterImpl(id, name);
    te.setNotLongerThanCheck(maxLen, "text.element.error.notlongerthan");
    setLabelIfNotNull(i18nLabel, te);
    te.setMaxLength(maxLen);
    te.setValue(val);
    formLayout.add(te);
    return te;
}
Also used : AutoCompleterImpl(org.olat.core.gui.components.form.flexible.impl.elements.AutoCompleterImpl)

Example 3 with AutoCompleterImpl

use of org.olat.core.gui.components.form.flexible.impl.elements.AutoCompleterImpl in project openolat by klemens.

the class FlexiTableElementImpl method setSearchEnabled.

@Override
public void setSearchEnabled(ListProvider autoCompleteProvider, UserSession usess) {
    searchEnabled = true;
    String dispatchId = component.getDispatchID();
    searchFieldEl = new AutoCompleterImpl(dispatchId + "_searchField", "search");
    searchFieldEl.showLabel(false);
    searchFieldEl.getComponent().addListener(this);
    ((AutoCompleterImpl) searchFieldEl).setListProvider(autoCompleteProvider, usess);
    components.put("rSearch", searchFieldEl);
    searchButton = new FormLinkImpl(dispatchId + "_searchButton", "rSearchButton", "search", Link.BUTTON);
    searchButton.setTranslator(translator);
    searchButton.setIconLeftCSS("o_icon o_icon_search");
    components.put("rSearchB", searchButton);
    rootFormAvailable(searchFieldEl);
    rootFormAvailable(searchButton);
}
Also used : FormLinkImpl(org.olat.core.gui.components.form.flexible.impl.elements.FormLinkImpl) AutoCompleterImpl(org.olat.core.gui.components.form.flexible.impl.elements.AutoCompleterImpl)

Example 4 with AutoCompleterImpl

use of org.olat.core.gui.components.form.flexible.impl.elements.AutoCompleterImpl in project OpenOLAT by OpenOLAT.

the class FlexiTableElementImpl method setSearchEnabled.

@Override
public void setSearchEnabled(ListProvider autoCompleteProvider, UserSession usess) {
    searchEnabled = true;
    String dispatchId = component.getDispatchID();
    searchFieldEl = new AutoCompleterImpl(dispatchId + "_searchField", "search");
    searchFieldEl.showLabel(false);
    searchFieldEl.getComponent().addListener(this);
    ((AutoCompleterImpl) searchFieldEl).setListProvider(autoCompleteProvider, usess);
    components.put("rSearch", searchFieldEl);
    searchButton = new FormLinkImpl(dispatchId + "_searchButton", "rSearchButton", "search", Link.BUTTON);
    searchButton.setTranslator(translator);
    searchButton.setIconLeftCSS("o_icon o_icon_search");
    components.put("rSearchB", searchButton);
    rootFormAvailable(searchFieldEl);
    rootFormAvailable(searchButton);
}
Also used : FormLinkImpl(org.olat.core.gui.components.form.flexible.impl.elements.FormLinkImpl) AutoCompleterImpl(org.olat.core.gui.components.form.flexible.impl.elements.AutoCompleterImpl)

Aggregations

AutoCompleterImpl (org.olat.core.gui.components.form.flexible.impl.elements.AutoCompleterImpl)4 FormLinkImpl (org.olat.core.gui.components.form.flexible.impl.elements.FormLinkImpl)2