Package org.exoplatform.webui.form

Examples of org.exoplatform.webui.form.UIFormSelectBox


        for (String key : keys) {
            if (key.equalsIgnoreCase("user.gender")) {
                List<SelectItemOption<String>> ls = new ArrayList<SelectItemOption<String>>();
                ls.add(new SelectItemOption<String>(MALE, MALE));
                ls.add(new SelectItemOption<String>(FEMALE, FEMALE));
                UIFormSelectBox genderSelectBox = new UIFormSelectBox(key, key, ls);
                set.addUIFormInput(genderSelectBox);
                continue;
            } else if (key.equalsIgnoreCase("user.jobtitle")) {
                set.addUIFormInput(new UIFormStringInput(key, null, null).addValidator(UserConfigurableValidator.class,
                        JOB_TITLE, UserConfigurableValidator.KEY_PREFIX + JOB_TITLE, false));
                continue;
            } else if (key.equalsIgnoreCase(Constants.USER_LANGUAGE)) {
                UIFormSelectBox langSelectBox = new UIFormSelectBox(key, key, null);
                set.addUIFormInput(langSelectBox);
                initLanguageCombo(langSelectBox);
                continue;
            }
View Full Code Here


    /**
     * Update language select box
     */
    @Override
    public void processRender(WebuiRequestContext context) throws Exception {
        UIFormSelectBox langSelectBox = this.findComponentById(Constants.USER_LANGUAGE);
        initLanguageCombo(langSelectBox);
        super.processRender(context);
    }
View Full Code Here

    private UserStatus statusFilter = UserStatus.ENABLED;

    public UIUserSelector() throws Exception {
        addUIFormInput(new UIFormStringInput(FIELD_KEYWORD, FIELD_KEYWORD, null));
        addUIFormInput(new UIFormSelectBox(FIELD_FILTER, FIELD_FILTER, getFilters()));
        addUIFormInput(new UIFormStringInput(FIELD_GROUP, FIELD_GROUP, null));
        isShowSearch_ = true;
        OrganizationService service = getApplicationComponent(OrganizationService.class);
        ObjectPageList objPageList = new ObjectPageList(service.getUserHandler().findUsers(new Query()).getAll(), 10);
        uiIterator_ = new UIPageIterator();
View Full Code Here

   static public 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();
         if (PortalConfig.USER_TYPE.equals(ownerType))
View Full Code Here

      UIFormInputSet uiPropertiesSet = new UIFormInputSet("Properties");
      uiSettingSet.addUIFormInput(
         new UIFormStringInput(FIELD_NAME, FIELD_NAME, null).addValidator(MandatoryValidator.class).addValidator(
            StringLengthValidator.class, 3, 30).addValidator(IdentifierValidator.class).setEditable(false))
         .addUIFormInput(
            new UIFormSelectBox(FIELD_LOCALE, FIELD_LOCALE, languages).addValidator(MandatoryValidator.class));

      List<SelectItemOption<String>> listSkin = new ArrayList<SelectItemOption<String>>();
      SkinService skinService = getApplicationComponent(SkinService.class);
      for (String skin : skinService.getAvailableSkinNames())
      {
         SelectItemOption<String> skinOption = new SelectItemOption<String>(skin, skin);
         if (uiPortal.getSkin().equals(skin))
         {
            skinOption.setSelected(true);
         }
         listSkin.add(skinOption);
      }
      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);
      addUIFormInput(uiPropertiesSet);

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

   }

   public void quickSearch(UIFormInputSet quickSearchInput) throws Exception
   {
      UIFormStringInput input = (UIFormStringInput)quickSearchInput.getChild(0);
      UIFormSelectBox select = (UIFormSelectBox)quickSearchInput.getChild(1);
      String value = input.getValue();
      String selectBoxValue = select.getValue();
      Query<Page> query = new Query<Page>(null, null, null, null, Page.class);
      if (selectBoxValue.equals("title"))
         query.setTitle(value);
      else if (selectBoxValue.equals("ownerType"))
         query.setOwnerType(value);
View Full Code Here

         ownerTypes.add(new SelectItemOption<String>(PortalConfig.PORTAL_TYPE));
      }
      ownerIdInput = new UIFormStringInput(OWNER_ID, OWNER_ID, null);
      ownerIdInput.setEditable(false).setValue(pcontext.getRemoteUser());

      UIFormSelectBox uiSelectBoxOwnerType = new UIFormSelectBox(OWNER_TYPE, OWNER_TYPE, ownerTypes);
      uiSelectBoxOwnerType.setOnChange("ChangeOwnerType");

      UIFormInputSet uiSettingSet = new UIFormInputSet("PageSetting");
      uiSettingSet.addUIFormInput(new UIFormStringInput("pageId", "pageId", null).setEditable(false)).addUIFormInput(
         uiSelectBoxOwnerType).addUIFormInput(ownerIdInput).addUIFormInput(
         new UIFormStringInput("name", "name", null).addValidator(StringLengthValidator.class, 3, 30).addValidator(
            IdentifierValidator.class).addValidator(MandatoryValidator.class)).addUIFormInput(
         new UIFormStringInput("title", "title", null).addValidator(StringLengthValidator.class, 3, 120))
         .addUIFormInput(new UIFormCheckBoxInput("showMaxWindow", "showMaxWindow", false));
      addUIFormInput(uiSettingSet);
      setSelectedTab(uiSettingSet.getId());

      WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
      Param param = initParams.getParam("PageTemplate");
      List<SelectItemCategory> itemCategories = (List<SelectItemCategory>)param.getMapGroovyObject(context);

      UIFormInputItemSelector uiTemplate = new UIFormInputItemSelector("Template", "template");
      uiTemplate.setItemCategories(itemCategories);
      addUIFormInput(uiTemplate);

      uiPermissionSetting = createUIComponent(UIFormInputSet.class, "PermissionSetting", null);
      UIListPermissionSelector uiListPermissionSelector = createUIComponent(UIListPermissionSelector.class, null, null);
      uiListPermissionSelector.configure("UIListPermissionSelector", "accessPermissions");
      uiListPermissionSelector.addValidator(EmptyIteratorValidator.class);
      uiPermissionSetting.addChild(uiListPermissionSelector);
      uiPermissionSetting.setSelectedComponent(uiListPermissionSelector.getId());
      UIPermissionSelector uiEditPermission = createUIComponent(UIPermissionSelector.class, null, null);
      uiEditPermission.setRendered(false);
      uiEditPermission.addValidator(org.exoplatform.webui.organization.UIPermissionSelector.MandatoryValidator.class);
      uiEditPermission.setEditable(false);
      uiEditPermission.configure("UIPermissionSelector", "editPermission");
      uiPermissionSetting.addChild(uiEditPermission);

      //TODO: This following line is fixed for bug PORTAL-2127
      uiListPermissionSelector.getChild(UIFormPopupWindow.class).setId("UIPageFormPopupGroupMembershipSelector");

      List<String> groups = configService.getMakableNavigations(pcontext.getRemoteUser(), true);
      if (groups.size() > 0)
      {
         ownerTypes.add(new SelectItemOption<String>(PortalConfig.GROUP_TYPE));
         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);
      }
      setActions(new String[]{"Save", "Close"});
   }
View Full Code Here

         // if edit navigation
         if (pageNav != null)
         {
            uiForm.invokeSetBindingBean(pageNav);
            UIFormSelectBox uiSelectBox = uiForm.findComponentById("priority");
            int priority = Integer.parseInt(uiSelectBox.getValue());
            pageNav.setPriority(priority);

            // update navigation
            dataService.save(pageNav);

            UIPopupWindow uiPopup = uiForm.getParent();
            uiPopup.setShow(false);
            UIComponent opener = uiPopup.getParent();
            pcontext.addUIComponentToUpdateByAjax(opener);
            return;
         }

         // if add navigation
         pageNav = new PageNavigation();
         // set properties for navigation
         uiForm.invokeSetBindingBean(pageNav);
         UIFormStringInput uiOwnerId = uiForm.findComponentById("ownerId");
         UIFormStringInput uiOwnerType = uiForm.findComponentById("ownerType");
         UIFormSelectBox uiSelectBox = uiForm.findComponentById("priority");
         int priority = Integer.parseInt(uiSelectBox.getValue());
         pageNav.setPriority(priority);
         pageNav.setModifiable(true);
         pageNav.setOwnerId(uiOwnerId.getValue());
         pageNav.setOwnerType(uiOwnerType.getValue());
         //UIPortalApplication uiPortalApp = uiForm.getAncestorOfType(UIPortalApplication.class);     
View Full Code Here

      {
         priorties.add(new SelectItemOption<String>(String.valueOf(i), String.valueOf(i)));
      }
      addUIFormInput(new UIFormStringInput("ownerType", "ownerType", getOwnerType()).setEditable(false))
         .addUIFormInput(new UIFormStringInput("ownerId", "ownerId", ownerId).setEditable(false)).addUIFormInput(
            new UIFormSelectBox("priority", null, priorties).setValue(getPriority()));
   }
View Full Code Here

      removeChildById("ownerId");     
      UIFormStringInput ownerId = new UIFormStringInput("ownerId", "ownerId", pageNavigation.getOwnerId());
      ownerId.setEditable(false);
      ownerId.setParent(this);
      getChildren().add(1, ownerId);
      UIFormSelectBox uiSelectBox = findComponentById("priority");
      uiSelectBox.setValue(String.valueOf(pageNavigation.getPriority()));
   }
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.