Search in sources :

Example 6 with TextElementImpl

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

the class FormUIFactory method addTextElement.

/**
 * @param id The unique identifier of this text element (can be null)
 * @param name
 * @param maxLen
 * @param initialValue
 * @param i18nLabel
 * @param formLayout
 * @return
 */
public TextElement addTextElement(String id, String name, final String i18nLabel, final int maxLen, String initialValue, FormItemContainer formLayout) {
    String val = initialValue == null ? "" : initialValue;
    TextElement te = new TextElementImpl(id, name, val);
    te.setNotLongerThanCheck(maxLen, "text.element.error.notlongerthan");
    setLabelIfNotNull(i18nLabel, te);
    te.setMaxLength(maxLen);
    formLayout.add(te);
    return te;
}
Also used : RichTextElement(org.olat.core.gui.components.form.flexible.elements.RichTextElement) StaticTextElement(org.olat.core.gui.components.form.flexible.elements.StaticTextElement) TextElement(org.olat.core.gui.components.form.flexible.elements.TextElement) RichTextElementImpl(org.olat.core.gui.components.form.flexible.impl.elements.richText.RichTextElementImpl) StaticTextElementImpl(org.olat.core.gui.components.form.flexible.impl.elements.StaticTextElementImpl) TextElementImpl(org.olat.core.gui.components.form.flexible.impl.elements.TextElementImpl)

Example 7 with TextElementImpl

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

the class FormUIFactory method addTextElement.

/**
 * @param id The unique identifier of this text element (can be null)
 * @param name
 * @param maxLen
 * @param initialValue
 * @param i18nLabel
 * @param formLayout
 * @return
 */
public TextElement addTextElement(String id, String name, final String i18nLabel, final int maxLen, String initialValue, FormItemContainer formLayout) {
    String val = initialValue == null ? "" : initialValue;
    TextElement te = new TextElementImpl(id, name, val);
    te.setNotLongerThanCheck(maxLen, "text.element.error.notlongerthan");
    setLabelIfNotNull(i18nLabel, te);
    te.setMaxLength(maxLen);
    formLayout.add(te);
    return te;
}
Also used : RichTextElement(org.olat.core.gui.components.form.flexible.elements.RichTextElement) StaticTextElement(org.olat.core.gui.components.form.flexible.elements.StaticTextElement) TextElement(org.olat.core.gui.components.form.flexible.elements.TextElement) RichTextElementImpl(org.olat.core.gui.components.form.flexible.impl.elements.richText.RichTextElementImpl) StaticTextElementImpl(org.olat.core.gui.components.form.flexible.impl.elements.StaticTextElementImpl) TextElementImpl(org.olat.core.gui.components.form.flexible.impl.elements.TextElementImpl)

Example 8 with TextElementImpl

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

the class FormUIFactory method addPasswordElement.

public TextElement addPasswordElement(String id, String name, final String i18nLabel, final int maxLen, String initialValue, FormItemContainer formLayout) {
    TextElement te = new TextElementImpl(id, name, initialValue, TextElementImpl.HTML_INPUT_TYPE_PASSWORD);
    te.setNotLongerThanCheck(maxLen, "text.element.error.notlongerthan");
    setLabelIfNotNull(i18nLabel, te);
    te.setMaxLength(maxLen);
    formLayout.add(te);
    return te;
}
Also used : RichTextElement(org.olat.core.gui.components.form.flexible.elements.RichTextElement) StaticTextElement(org.olat.core.gui.components.form.flexible.elements.StaticTextElement) TextElement(org.olat.core.gui.components.form.flexible.elements.TextElement) RichTextElementImpl(org.olat.core.gui.components.form.flexible.impl.elements.richText.RichTextElementImpl) StaticTextElementImpl(org.olat.core.gui.components.form.flexible.impl.elements.StaticTextElementImpl) TextElementImpl(org.olat.core.gui.components.form.flexible.impl.elements.TextElementImpl)

Aggregations

TextElementImpl (org.olat.core.gui.components.form.flexible.impl.elements.TextElementImpl)8 RichTextElement (org.olat.core.gui.components.form.flexible.elements.RichTextElement)6 StaticTextElement (org.olat.core.gui.components.form.flexible.elements.StaticTextElement)6 TextElement (org.olat.core.gui.components.form.flexible.elements.TextElement)6 StaticTextElementImpl (org.olat.core.gui.components.form.flexible.impl.elements.StaticTextElementImpl)6 RichTextElementImpl (org.olat.core.gui.components.form.flexible.impl.elements.richText.RichTextElementImpl)6 FormLinkImpl (org.olat.core.gui.components.form.flexible.impl.elements.FormLinkImpl)2