Examples of FormItem


Examples of org.olat.core.gui.components.form.flexible.FormItem

          return;
        }       
        /*
         * evaluate normal inner form events
         */
        FormItem fiSrc = fe.getFormItemSource();
        // check for InlineElments
        if(fiSrc instanceof InlineElement){
          this.flc.setDirty(true);
        }
        //
View Full Code Here

Examples of org.olat.core.gui.components.form.flexible.FormItem

     */
    if (actiontype == FormItemDependencyRuleImpl.CUSTOM) {
      applayable.apply(triggerElement, triggerVal, targets);
    } else {
      for (Iterator iter = targets.iterator(); iter.hasNext();) {
        FormItem element = (FormItem) iter.next();
        switch (actiontype) {
          case FormItemDependencyRuleImpl.MAKE_INVISIBLE:
            element.setVisible(false);
            break;
          case FormItemDependencyRuleImpl.MAKE_VISIBLE:
            element.setVisible(true);
            break;
          case FormItemDependencyRuleImpl.MAKE_READONLY:
            element.setEnabled(false);
            break;
          case FormItemDependencyRuleImpl.MAKE_WRITABLE:
            element.setEnabled(true);
            break;
          case FormItemDependencyRuleImpl.HIDE_ERROR:
            element.showError(false);
            break;
          case FormItemDependencyRuleImpl.RESET:
            element.reset();
            break;
          default:
            throw new AssertException("unsupported action in dependency rule");
        }
      }
View Full Code Here

Examples of org.olat.core.gui.components.form.flexible.FormItem

    formLayout.add(closeLink);
    // add all step titles, but disabled.
    Step tmp = startStep;
    maxSteps = 0;
    do {
      FormItem title = tmp.getStepTitle();
      title.setEnabled(false);
      stepTitleLinks.add(title);
      maxSteps++;
      tmp = tmp.nextStep();
    } while (tmp != Step.NOSTEP);
    // init buttons and the like
View Full Code Here

Examples of org.olat.core.gui.components.form.flexible.FormItem

      } else if (event instanceof FormEvent) {
        /*
         * evaluate inner form events
         */
        FormEvent fe = (FormEvent) event;
        FormItem fiSrc = fe.getFormItemSource();
        //
        formInnerEvent(ureq, fiSrc, fe);
        // no need to set container dirty, up to controller code if something is dirty
      }
    }
View Full Code Here

Examples of org.olat.core.gui.components.form.flexible.FormItem

    createOrUpdateSynonymLayout(formLayout, glossItemSynonyms);
  }

  private void createOrUpdateSynonymLayout(FormItemContainer formLayout, ArrayList<String> glossItemSynonymsToUse){
    FormUIFactory formUIf = FormUIFactory.getInstance();
    FormItem synLay = formLayout.getFormComponent("synonymLayout");
    if (synLay != null) {
      formLayout.remove("synonymLayout");
    }
    FormLayoutContainer tmpLayout = FormLayoutContainer.createCustomFormLayout("synonymLayout", getTranslator(), velocity_root
        + "/editSynonym.html");
View Full Code Here

Examples of org.olat.core.gui.components.form.flexible.FormItem

      } else {
        uifactory.addSpacerElement("spacer_" + userPropertyHandler.getName(), formLayout, true);
      }
     
      // add input field to container
      FormItem formItem = userPropertyHandler.addFormItem(getLocale(), this.identity.getUser(), this.usageIdentifier, this.isAdministrativeUser, formLayout);
      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) {
          checkbox.select(propertyName, value.equals("true"));
        } else {
          // assume "false" if the property is not present
          checkbox.select(propertyName, false);
        }
      }
     
      // special case for email field
      if (userPropertyHandler.getName().equals("email")) {
        RegistrationManager rm = RegistrationManager.getInstance();
        String key = this.identity.getUser().getProperty("emchangeKey", null);
        TemporaryKeyImpl tempKey = rm.loadTemporaryKeyByRegistrationKey(key);
        if (tempKey != null) {
          XStream xml = new XStream();
          HashMap<String, String> mails = (HashMap<String, String>) xml.fromXML(tempKey.getEmailAddress());
          formItem.setExampleKey("email.change.form.info", new String[] {mails.get("changedEMail")});
        }
      }
    }
   
    // add the "about me" text field.
View Full Code Here

Examples of org.olat.core.gui.components.form.flexible.FormItem

    // For each user property...
    for (UserPropertyHandler userPropertyHandler : this.userPropertyHandlers) {

      // ...get the value from the form field and store it into the user
      // property...
      FormItem formItem = this.formItems.get(userPropertyHandler.getName());

      userPropertyHandler.updateUserFromFormItem(user, formItem);

      // ...and store the "publish" flag for each property.
      MultipleSelectionElement checkbox = this.publishCheckboxes.get("checkbox_" + userPropertyHandler.getName());
View Full Code Here

Examples of org.olat.core.gui.components.form.flexible.FormItem

   */
  public Identity updateIdentityFromFormData(Identity id) {
    User user = id.getUser();
    // update each user field
    for (UserPropertyHandler userPropertyHandler : userPropertyHandlers) {
      FormItem formItem = this.formItems.get(userPropertyHandler.getName());

      userPropertyHandler.updateUserFromFormItem(user, formItem);
    }
    return id;
  }
View Full Code Here

Examples of org.olat.core.gui.components.form.flexible.FormItem

  @Override
  protected boolean validateFormLogic(UserRequest ureq) {
    boolean formOK = true;
    for (UserPropertyHandler userPropertyHandler : this.userPropertyHandlers) {

      FormItem formItem = this.formItems.get(userPropertyHandler.getName());

      if (!userPropertyHandler.isValid(formItem, this.formContext)) {
        formOK = false;
      } else {
        formItem.clearError();
      }
    }
   
    try {
      String aboutMe = textAboutMe.getValue();
View Full Code Here

Examples of org.olat.core.gui.components.form.flexible.FormItem

  @Override
  protected void event(UserRequest ureq, Controller source, Event event) {
    if (event instanceof FormEvent) {
      FormEvent fe = (FormEvent) event;
      FormItem sourceItem = fe.getFormItemSource();
      String compName = sourceItem.getName();
      if (columnAddRow.contains(compName)) {
        // add link clicked
        int clickPos = ((Integer) sourceItem.getUserObject()).intValue();
        addRowAt(clickPos + 1);
      } else if (columnRemoveRow.contains(compName)) {
        // remove link clicked
        int clickPos = ((Integer) sourceItem.getUserObject()).intValue();
        removeRowAt(clickPos);
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.