Package org.exoplatform.webui.form

Examples of org.exoplatform.webui.form.UIFormSelectBox


     */
    public static class ChangeLanguageActionListener extends EventListener<UIWizardPageSetInfo> {
        @Override
        public void execute(Event<UIWizardPageSetInfo> event) throws Exception {
            UIWizardPageSetInfo uiForm = event.getSource();
            UIFormSelectBox languageSelection = uiForm.getUIFormSelectBox(LANGUAGES);
            UIFormStringInput label = uiForm.getUIStringInput(I18N_LABEL);
            uiForm.updateCachedLabels(uiForm.selectedLocale, label.getValue());

            uiForm.selectedLocale = languageSelection.getValue();
            label.setValue(uiForm.getLabelOnLocale(uiForm.selectedLocale));
            event.getRequestContext().addUIComponentToUpdateByAjax(uiForm);
        }
View Full Code Here


    }

    public static class ChangeOwnerTypeActionListener extends EventListener<UIPageForm> {
        public void execute(Event<UIPageForm> event) throws Exception {
            UIPageForm uiForm = event.getSource();
            UIFormSelectBox uiSelectBox = uiForm.getUIFormSelectBox(OWNER_TYPE);
            String ownerType = uiSelectBox.getValue();
            PortalRequestContext prContext = Util.getPortalRequestContext();
            UIFormInputSet uiSettingSet = uiForm.getChildById("PageSetting");
            uiForm.setSelectedTab("PageSetting");
            List<UIComponent> list = uiSettingSet.getChildren();
View Full Code Here

    }

    public static class ChangeOwnerIdActionListener extends EventListener<UIPageForm> {
        public void execute(Event<UIPageForm> event) throws Exception {
            UIPageForm uiForm = event.getSource();
            UIFormSelectBox uiSelectBox = uiForm.getUIFormSelectBox(OWNER_TYPE);
            String ownerType = uiSelectBox.getValue();
            uiForm.buildMovePermissionForm(new SiteKey(ownerType, uiForm.ownerIdInput.getValue()));
            if (SiteType.GROUP.getName().equals(ownerType)) {
                String ownerId = uiForm.groupIdSelectBox.getValue();
                uiForm.setDefaultPermissions(ownerType, ownerId);
            } else {
View Full Code Here

    public UIPageSearchForm() throws Exception {
        UIFormInputSet uiQuickSearchSet = new UIFormInputSet(QUICK_SEARCH_SET);
        uiQuickSearchSet.addUIFormInput(new UIFormStringInput("pageTitle", "pageTitle", null));
        uiQuickSearchSet.addUIFormInput(new UIFormStringInput("siteName", "siteName", null).addValidator(
                ExpressionValidator.class, "[^\\'\"]*", "UISearchForm.msg.empty"));
        uiQuickSearchSet.addUIFormInput(new UIFormSelectBox("searchOption", null, null));
        addChild(uiQuickSearchSet);
    }
View Full Code Here

        uiQuickSearchSet.addUIFormInput(new UIFormSelectBox("searchOption", null, null));
        addChild(uiQuickSearchSet);
    }

    public void setOptions(List<SelectItemOption<String>> options) {
        UIFormSelectBox uiSelect = (UIFormSelectBox) getQuickSearchInputSet().getChild(2);
        uiSelect.setOptions(options);
    }
View Full Code Here

                .addValidator(StringLengthValidator.class, 3, 30).addValidator(IdentifierValidator.class).setReadOnly(true));

        uiSettingSet.addUIFormInput(new UIFormStringInput(FIELD_LABEL, FIELD_LABEL, null)
                .addValidator(SpecialCharacterValidator.class));
        uiSettingSet.addUIFormInput(new UIFormStringInput(FIELD_DESCRIPTION, FIELD_DESCRIPTION, null));
        uiSettingSet.addUIFormInput(new UIFormSelectBox(FIELD_LOCALE, FIELD_LOCALE, languages)
                .addValidator(MandatoryValidator.class));

        List<SelectItemOption<String>> listSkin = new ArrayList<SelectItemOption<String>>();
        SkinService skinService = getApplicationComponent(SkinService.class);
        List<String> skinNames = new ArrayList<String>(skinService.getAvailableSkinNames());
        Collections.sort(skinNames);
        for (String skin : skinNames) {
            SelectItemOption<String> skinOption = new SelectItemOption<String>(skin, skin);
            listSkin.add(skinOption);
        }
        listSkin.get(0).setSelected(true);

        UIFormSelectBox uiSelectBox = new UIFormSelectBox(FIELD_SKIN, FIELD_SKIN, listSkin);
        uiSettingSet.addUIFormInput(uiSelectBox);

        addUIFormInput(uiSettingSet);

        // add to properties tab
        List<SelectItemOption<String>> listSessionAlive = new ArrayList<SelectItemOption<String>>();
        listSessionAlive.add(new SelectItemOption<String>(PortalProperties.SESSION_ALWAYS, PortalProperties.SESSION_ALWAYS));
        listSessionAlive.add(new SelectItemOption<String>(PortalProperties.SESSION_ON_DEMAND,
                PortalProperties.SESSION_ON_DEMAND));
        listSessionAlive.add(new SelectItemOption<String>(PortalProperties.SESSION_NEVER, PortalProperties.SESSION_NEVER));
        UIFormSelectBox uiSessionAliveBox = new UIFormSelectBox(FIELD_SESSION_ALIVE, FIELD_SESSION_ALIVE, listSessionAlive);
        uiSessionAliveBox.setValue(PortalProperties.SESSION_ON_DEMAND);
        uiPropertiesSet.addUIFormInput(uiSessionAliveBox);

        UIFormStringInput uiCacheControlinput = new UIFormStringInput(FIELD_CACHE_CONTROL, FIELD_CACHE_CONTROL, null);
        uiCacheControlinput.setReadOnly(false);
        uiPropertiesSet.addChild(uiCacheControlinput);

        // TODO add more box for showPortletMode and showWindowState if needed
        UIFormCheckBoxInput<Boolean> uiShowInfobarBox = new UIFormCheckBoxInput<Boolean>(FIELD_SHOW_INFOBAR,
                FIELD_SHOW_INFOBAR, true);
        uiShowInfobarBox.setOnChange("CheckShowInfobar");
        uiPropertiesSet.addChild(uiShowInfobarBox);

        UIFormStringInput uiViewportInput = new UIFormStringInput(FIELD_VIEWPORT, FIELD_VIEWPORT, null);
        uiViewportInput.setReadOnly(false);
        uiPropertiesSet.addChild(uiViewportInput);

        addUIFormInput(uiPropertiesSet);

        List<SelectItemOption<String>> listSharedLayout = new ArrayList<SelectItemOption<String>>();
        listSharedLayout.add(new SelectItemOption<String>(PortalProperties.SHARED_LAYOUT_ALL, PortalProperties.SHARED_LAYOUT_ALL));
        listSharedLayout.add(new SelectItemOption<String>(PortalProperties.SHARED_LAYOUT_ADMINS, PortalProperties.SHARED_LAYOUT_ADMINS));
        UIFormSelectBox sharedLayoutSelectBox = new UIFormSelectBox(FIELD_SHARED_LAYOUT, FIELD_SHARED_LAYOUT, listSharedLayout);
        sharedLayoutSelectBox.setValue(PortalProperties.SHARED_LAYOUT_ALL);
        uiPropertiesSet.addUIFormInput(sharedLayoutSelectBox);

        UIFormInputSet uiPermissionSetting = createUIComponent(UIFormInputSet.class, "PermissionSetting", null);
        addUIComponentInput(uiPermissionSetting);
View Full Code Here

    public Query<Page> getQuery(UIFormInputSet searchInputs) {
        Query<Page> query = new Query<Page>(null, null, null, null, Page.class);
        UIFormStringInput titleInput = (UIFormStringInput) searchInputs.getChild(0);
        UIFormStringInput siteNameInput = (UIFormStringInput) searchInputs.getChild(1);
        UIFormSelectBox select = (UIFormSelectBox) searchInputs.getChild(2);

        String siteName = siteNameInput.getValue();
        String title = titleInput.getValue();
        String ownerType = select.getValue();
        if (title != null) {
            query.setTitle(title.trim());
        }
        if (siteName != null && !siteName.trim().equals("")) {
            query.setOwnerId(siteName.trim());
View Full Code Here

            String currentUser = prContext.getRemoteUser();
            if (currentUser != null) {
                UIPageForm uiPageForm = uiMaskWS.createUIComponent(UIPageForm.class, "UIBrowserPageForm", "UIPageForm");
                uiPageForm.buildForm(null);

                UIFormSelectBox slcOwnerType = uiPageForm.getUIFormSelectBox(UIPageForm.OWNER_TYPE);
                List<SelectItemOption<String>> types = slcOwnerType.getOptions();
                for (int i = 0; i < types.size(); i++) {
                    if (PortalConfig.USER_TYPE.equals(types.get(i).getValue())) {
                        types.remove(types.get(i));
                        break;
                    }
                }

                if (!types.isEmpty()) {
                    hasPermission = true;

                    slcOwnerType.setOptions(types);
                    Event<UIComponent> slcEvent = uiPageForm.createEvent("ChangeOwnerType", Phase.DECODE, event.getRequestContext());
                    slcEvent.broadcast();

                    uiMaskWS.setUIComponent(uiPageForm);
                    uiMaskWS.setShow(true);
View Full Code Here

                Collections.sort(groups);
                List<SelectItemOption<String>> groupsItem = new ArrayList<SelectItemOption<String>>();
                for (String group : groups) {
                    groupsItem.add(new SelectItemOption<String>(group));
                }
                groupIdSelectBox = new UIFormSelectBox(OWNER_ID, OWNER_ID, groupsItem);
                groupIdSelectBox.setOnChange("ChangeOwnerId");
                groupIdSelectBox.setParent(uiSettingSet);
            }
        }
    }
View Full Code Here

        if (groups.size() > 0) {
            ownerTypes.add(new SelectItemOption<String>(SiteType.GROUP.getName()));
        }

        ownerTypes.add(new SelectItemOption<String>(SiteType.USER.getName()));
        UIFormSelectBox uiSelectBoxOwnerType = new UIFormSelectBox(OWNER_TYPE, OWNER_TYPE, ownerTypes);
        uiSelectBoxOwnerType.setOnChange("ChangeOwnerType");
        uiSettingSet.addUIFormInput(uiSelectBoxOwnerType);

        ownerIdInput = new UIFormStringInput(OWNER_ID, OWNER_ID, null);
        ownerIdInput.setReadOnly(true).setValue(pcontext.getRemoteUser());
        uiSettingSet.addUIFormInput(ownerIdInput);
View Full Code Here

TOP

Related Classes of org.exoplatform.webui.form.UIFormSelectBox

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.