Search in sources :

Example 1 with FlexiAutoCompleterController

use of org.olat.core.gui.control.generic.ajax.autocompletion.FlexiAutoCompleterController in project OpenOLAT by OpenOLAT.

the class EMailCalloutCtrl method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    Roles roles = ureq.getUserSession().getRoles();
    boolean autoCompleteAllowed = securityModule.isUserAllowedAutoComplete(roles);
    boolean isAdministrativeUser = securityModule.isUserAllowedAdminProps(roles);
    if (autoCompleteAllowed) {
        ListProvider provider = new UserSearchListProvider();
        autocompleterC = new FlexiAutoCompleterController(ureq, getWindowControl(), provider, null, isAdministrativeUser, allowExternalAddress, 60, 3, null, mainForm);
        autocompleterC.setFormElement(false);
        listenTo(autocompleterC);
        FormItem item = autocompleterC.getInitialFormItem();
        formLayout.add(item);
    } else if (allowExternalAddress) {
        emailEl = uifactory.addTextElement("email" + CodeHelper.getRAMUniqueID(), "email", null, 256, "", formLayout);
    }
}
Also used : FormItem(org.olat.core.gui.components.form.flexible.FormItem) UserSearchListProvider(org.olat.admin.user.UserSearchListProvider) ListProvider(org.olat.core.gui.control.generic.ajax.autocompletion.ListProvider) UserSearchListProvider(org.olat.admin.user.UserSearchListProvider) Roles(org.olat.core.id.Roles) FlexiAutoCompleterController(org.olat.core.gui.control.generic.ajax.autocompletion.FlexiAutoCompleterController)

Example 2 with FlexiAutoCompleterController

use of org.olat.core.gui.control.generic.ajax.autocompletion.FlexiAutoCompleterController in project openolat by klemens.

the class EMailCalloutCtrl method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    Roles roles = ureq.getUserSession().getRoles();
    boolean autoCompleteAllowed = securityModule.isUserAllowedAutoComplete(roles);
    boolean isAdministrativeUser = securityModule.isUserAllowedAdminProps(roles);
    if (autoCompleteAllowed) {
        ListProvider provider = new UserSearchListProvider();
        autocompleterC = new FlexiAutoCompleterController(ureq, getWindowControl(), provider, null, isAdministrativeUser, allowExternalAddress, 60, 3, null, mainForm);
        autocompleterC.setFormElement(false);
        listenTo(autocompleterC);
        FormItem item = autocompleterC.getInitialFormItem();
        formLayout.add(item);
    } else if (allowExternalAddress) {
        emailEl = uifactory.addTextElement("email" + CodeHelper.getRAMUniqueID(), "email", null, 256, "", formLayout);
    }
}
Also used : FormItem(org.olat.core.gui.components.form.flexible.FormItem) UserSearchListProvider(org.olat.admin.user.UserSearchListProvider) ListProvider(org.olat.core.gui.control.generic.ajax.autocompletion.ListProvider) UserSearchListProvider(org.olat.admin.user.UserSearchListProvider) Roles(org.olat.core.id.Roles) FlexiAutoCompleterController(org.olat.core.gui.control.generic.ajax.autocompletion.FlexiAutoCompleterController)

Aggregations

UserSearchListProvider (org.olat.admin.user.UserSearchListProvider)2 FormItem (org.olat.core.gui.components.form.flexible.FormItem)2 FlexiAutoCompleterController (org.olat.core.gui.control.generic.ajax.autocompletion.FlexiAutoCompleterController)2 ListProvider (org.olat.core.gui.control.generic.ajax.autocompletion.ListProvider)2 Roles (org.olat.core.id.Roles)2