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

Examples of org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement.select()


   
    this.formContext.put("username", this.identity.getName());

    // Add the noneditable username field.
    MultipleSelectionElement usernameCheckbox = uifactory.addCheckboxesHorizontal("checkbox_username", null, formLayout, new String[] {"checkbox_username"}, new String[] {""}, null);
    usernameCheckbox.select("checkbox_username", true);
    usernameCheckbox.setEnabled(false);
    StaticTextElement usernameText = uifactory.addStaticTextElement("username", this.identity.getName(), formLayout);
    usernameText.setMandatory(true);
    this.formItems.put("username", usernameText);
   
View Full Code Here


        String checkboxName = "checkbox_" + userPropertyHandler.getName();
        MultipleSelectionElement publishCheckbox = uifactory.addCheckboxesHorizontal(checkboxName, null, formLayout, new String[] {userPropertyHandler.i18nFormElementLabelKey()}, new String[] {""}, null);
        this.publishCheckboxes.put(checkboxName, publishCheckbox);
        boolean isEnabled = this.conf.isEnabled(userPropertyHandler.getName());
        if (isEnabled) {
          publishCheckbox.select(userPropertyHandler.i18nFormElementLabelKey(), true);
        } else {
          publishCheckbox.select(userPropertyHandler.i18nFormElementLabelKey(), false);
        }       
        // Mandatory homepage properties can not be changed by user
        UserManager um = UserManager.getInstance();
View Full Code Here

        this.publishCheckboxes.put(checkboxName, publishCheckbox);
        boolean isEnabled = this.conf.isEnabled(userPropertyHandler.getName());
        if (isEnabled) {
          publishCheckbox.select(userPropertyHandler.i18nFormElementLabelKey(), true);
        } else {
          publishCheckbox.select(userPropertyHandler.i18nFormElementLabelKey(), false);
        }       
        // Mandatory homepage properties can not be changed by user
        UserManager um = UserManager.getInstance();
        if (um.isMandatoryUserProperty(HomePageConfig.class.getCanonicalName(), userPropertyHandler)) {
          publishCheckbox.select(userPropertyHandler.i18nFormElementLabelKey(), true);
View Full Code Here

          publishCheckbox.select(userPropertyHandler.i18nFormElementLabelKey(), false);
        }       
        // Mandatory homepage properties can not be changed by user
        UserManager um = UserManager.getInstance();
        if (um.isMandatoryUserProperty(HomePageConfig.class.getCanonicalName(), userPropertyHandler)) {
          publishCheckbox.select(userPropertyHandler.i18nFormElementLabelKey(), true);
          publishCheckbox.setEnabled(false);
        }
      } else {
        uifactory.addSpacerElement("spacer_" + userPropertyHandler.getName(), formLayout, true);
      }
View Full Code Here

      } 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);
        }
      }
View Full Code Here

        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")) {
View Full Code Here

    lTarget.setUserObject(link);
    lTargetInputList.add(index, lTarget);
    //add html target
    MultipleSelectionElement htmlTargetSelection = uifactory.addCheckboxesHorizontal("html_target" + counter, titleContainer, new String[]{BLANK_KEY}, new String[]{""}, null);
    htmlTargetSelection.setUserObject(link);
    htmlTargetSelection.select(BLANK_KEY, "_blank".equals(link.getHtmlTarget()));
    lHtmlTargetInputList.add(index, htmlTargetSelection);
   
    // add link description
    TextElement lDescription = uifactory.addTextElement("description" + counter, null, -1, link.getDescription(), titleContainer);
    lDescription.clearError();
View Full Code Here

      // add input field for password
      Map configuration = BaseSecurityModule.getConfiguration();
      Boolean canChangePwd = (Boolean) configuration.get(BaseSecurityModule.CONFIG_USERMANAGER_CAN_MODIFY_PWD);
      if (canChangePwd.booleanValue() || isOLATAdmin) {
        checkbox = uifactory.addCheckboxesVertical("checkboxPWD", "form.name.pwd", innerFormLayout, new String[] { "changePWD" }, new String[] { "" }, null, 1);
        checkbox.select("changePWD", false);
        checkbox.addActionListener(listener, FormEvent.ONCLICK);
        formitem = uifactory.addTextElement(UserBulkChangeManager.PWD_IDENTIFYER, "password", 127, null, innerFormLayout);
        TextElement formEl = (TextElement) formitem;
        formEl.setDisplaySize(35);
        formitem.setLabel(null, null);
View Full Code Here

        languageKeys[p] = key;
        languageValues[p] = locdescs.get(key);
        p++;
      }
      checkbox = uifactory.addCheckboxesVertical("checkboxLang", "form.name.language", innerFormLayout, new String[] { "changeLang" }, new String[] { "" }, null, 1);
      checkbox.select("changeLang", false);
      checkbox.addActionListener(listener, FormEvent.ONCLICK);
      formitem = uifactory.addDropdownSingleselect(UserBulkChangeManager.LANG_IDENTIFYER, innerFormLayout, languageKeys, languageValues, null);
      formitem.setLabel(null, null);
      targets = new HashSet<FormItem>();
      targets.add(formitem);
View Full Code Here

      UserPropertyHandler userPropertyHandler;
      for (int i = 0; i < userPropertyHandlers.size(); i++) {
        userPropertyHandler = userPropertyHandlers.get(i);

        checkbox = uifactory.addCheckboxesVertical("checkbox" + i, "form.name." + userPropertyHandler.getName(), innerFormLayout, new String[] { "change" + userPropertyHandler.getName() }, new String[] { "" }, null, 1);
        checkbox.select("change" + userPropertyHandler.getName(), false);
        checkbox.addActionListener(listener, FormEvent.ONCLICK);

        formitem = userPropertyHandler.addFormItem(getLocale(), null, usageIdentifyer, isAdministrativeUser, innerFormLayout);
        formitem.setLabel(null, null);
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.