Package org.olat.core.gui.components.form.flexible.elements

Examples of org.olat.core.gui.components.form.flexible.elements.TextElement


    formLayout.add(ste);
    return ste;
  }
 
  public TextElement addInlineTextElement(String name, String value, FormItemContainer formLayout, FormBasicController listener) {
    TextElement ie = new TextElementImpl(name, value, TextElementImpl.HTML_INPUT_TYPE_TEXT, true);
    ie.addActionListener(listener, FormEvent.ONCLICK);
    if(listener != null){
      formLayout.add(ie);
    }
    return ie;
  }
View Full Code Here


   * @param formLayout
   * @return
   */
  public TextElement addTextElement(String name, final String i18nLabel, final int maxLen, String initialValue,
      FormItemContainer formLayout) {
    TextElement te = new TextElementImpl(name, initialValue);
    te.setNotLongerThanCheck(maxLen, "text.element.error.notlongerthan");
    setLabelIfNotNull(i18nLabel, te);
    te.setMaxLength(maxLen);
    formLayout.add(te);
    return te;
  }
View Full Code Here

    return te;
  }
 
  public TextElement addPasswordElement(String name, final String i18nLabel, final int maxLen, String initialValue,
      FormItemContainer formLayout) {
    TextElement te = new TextElementImpl(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;
  }
View Full Code Here

   * @param formLayout
   * @return
   */
  public TextElement addTextAreaElement(String name, final String i18nLabel, final int maxLen, final int rows, final int cols, boolean isAutoHeightEnabled, String initialValue,
    FormItemContainer formLayout) {
    TextElement te = new TextAreaElementImpl(name, initialValue, rows, cols, isAutoHeightEnabled) {
      {
        setNotLongerThanCheck(maxLen, "text.element.error.notlongerthan");
        // the text.element.error.notlongerthan uses a variable {0} that
        // contains the length maxLen
      }
View Full Code Here

    hideItems.add(newVariant);
    // Rule 2: show variant when country is not empty
    FormItemDependencyRule showRule = new FormItemDependencyRuleImpl(newCountry, ".{2}", hideItems, FormItemDependencyRuleImpl.MAKE_VISIBLE) {
      @Override
      protected boolean doesTrigger() {
        TextElement te = (TextElement) this.triggerElement;
        String val = te.getValue();
        //
        if (val == null && triggerVal == null) {
          // triggerVal and val are NULL -> true
          return true;
        } else if (val != null) {
View Full Code Here

  /**
   * @see org.olat.core.gui.components.form.flexible.rules.FormItemDependencyRuleImpl#doesTrigger()
   */
  @Override
  protected boolean doesTrigger() {
    TextElement te = (TextElement)this.triggerElement;
    String val = te.getValue();
    //
    if(val == null && triggerVal == null){
      //triggerVal and val are NULL -> true
      return true;
    }else if(triggerVal != null){
View Full Code Here

    tmpLayout.contextPut("glossItemSynonyms", glossItemSynonymsToUse);

    // add input fields with existing synonyms
    synonymTextElementList = new ArrayList<TextElement>(glossItemSynonymsToUse.size());
    for (int synNum = 1; synNum < glossItemSynonymsToUse.size() + 1; synNum++) {
      TextElement tmpSynonymTE = formUIf.addTextElement(SYNONYM_TEXT_ELEMENT + synNum, null, 100, glossItemSynonymsToUse.get(synNum - 1), tmpLayout);
      synonymTextElementList.add(tmpSynonymTE);
    }

    // add delete-links for existing synonyms
    for (int linkNum = 1; linkNum < glossItemSynonymsToUse.size() + 1; linkNum++) {
View Full Code Here

      String propertyName = userPropertyHandler.getName();
      this.formItems.put(propertyName, formItem);
     
      if (formItem instanceof TextElement) {
        // it's a text field, so get the value of this property into the text field
        TextElement textElement = (TextElement)formItem;
        textElement.setValue(this.identity.getUser().getProperty(propertyName, getLocale()));
      } else if (formItem instanceof MultipleSelectionElement) {
        // it's a checkbox, so set the box to checked if the corresponding property is set to "true"
        MultipleSelectionElement checkbox = (MultipleSelectionElement)formItem;
        String value = this.identity.getUser().getProperty(propertyName, getLocale());
        if (value != null) {
View Full Code Here

        } else {
          // user did not actively select one, maybe because the first one was already the one he wanted. Use this one
          condValue = valuessi.getKey(0);
        }
      } else {
        TextElement valuetei = (TextElement) flc.getFormComponent(PRE_VALUE_TEXT + row);
        condValue = valuetei.getValue();
      }
      le.add(new ExtendedCondition(condName, condOperator, condValue));
    }
    return le;
  }
View Full Code Here

    columnOperator.add(rowPos, operator.getName());

    // 2c) Attribute value - can be either a text input field or a selection
    // drop down box - create both and hide the selection box
    //
    TextElement valuetxt = uifactory.addTextElement(PRE_VALUE_TEXT + rowCreationCounter, null, -1, null, flc);
    valuetxt.setDisplaySize(25);
    valuetxt.setNotEmptyCheck("form.easy.error.attribute");
    valuetxt.setUserObject(Integer.valueOf(rowPos));
    columnValueText.add(rowPos, valuetxt.getName());
    // now the selection box
    FormItem iselect = uifactory.addDropdownSingleselect(PRE_VALUE_SELECTION + rowCreationCounter, null, flc, new String[0], new String[0], null);
    iselect.setUserObject(Integer.valueOf(rowPos));
    iselect.setVisible(false);
    columnValueSelection.add(rowPos, iselect.getName());
View Full Code Here

TOP

Related Classes of org.olat.core.gui.components.form.flexible.elements.TextElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.