select.setLabel(dcInput.getLabel()); select.setHelp(cleanHints(dcInput.getHints())); if (dcInput.isRequired()) select.setRequired(); select.addError(dcInput.getWarning()); select.addError(T_required_field); select.setMultiple(); select.setSize(6); select.setDisabled(); select.addOption(value,display); select.setOptionSelected(dcValue.value);
/** * Add a menu input control which allows the user to select from a list of * available options. * * @param name * (Required) a non-unique local identifier used to differentiate * the element from its siblings within an interactive division. * This is the name of the field use when data is submitted back * to the server. * @param rend * (May be null) a rendering hint used to override the default * display of the element. * @return a new select field */ public Select addSelect(String name, String rend) throws WingException { Select select = new Select(context, name, rend); fields.add(select); return select; }
/** * Add a select option. * * @param selected * (Required) Set the field as selected. * @param returnValue * (Required) The value to be passed back if this option is * selected. */ public Option addOption(boolean selected, String returnValue) throws WingException { if (selected) { setOptionSelected(returnValue); } return addOption(returnValue); }
Select country = form.addItem().addSelect("country "); country.setLabel("Country"); country.addOption("", "Please select your country"); Enumeration<?> countries = ConfigurationManager.propertyNames("countries"); while (countries.hasMoreElements()) { String key = (String) countries.nextElement(); String value = ConfigurationManager.getProperty("countries", key); country.addOption(key, value); }
select.setLabel("Text"); select.enableAddOperation(); select.enableDeleteOperation(); select.setMultiple(); select.setSize(4); if (help) select.setHelp("This is helpfull text."); select.addError("This field is in error."); select.addOption("one", "uno"); select.addOption("two", "dos"); select.addOption("three", "tres"); select.addOption("four", "cuatro"); select.addOption("five", "cinco"); instance = select.addInstance(); instance.setOptionSelected("one"); instance = select.addInstance(); instance.setOptionSelected("one"); instance.setOptionSelected("two"); instance = select.addInstance(); instance.setOptionSelected("one"); instance.setOptionSelected("two"); instance.setOptionSelected("three");
select.setLabel("Select (single)"); if (help) select.setHelp("Select one of the options"); select.addError("This field is in error."); select.addOption("one","uno"); select.addOption("two","dos"); select.addOption("three","tres"); select.addOption("four","cuatro"); select.addOption("five","cinco"); select.setOptionSelected("one"); select.setLabel("Select (multiple)"); select.setMultiple(); select.setSize(4); if (help) select.setHelp("Select one or more options"); select.addError("This field is in error."); select.addOption("one","uno"); select.addOption("two","dos"); select.addOption("three","tres"); select.addOption("four","cuatro"); select.addOption("five","cinco"); select.setOptionSelected("one");
lang.setLabel(T_language); if (supportedLocales.length > 0) lang.addOption(lc.toString(), lc.getDisplayName()); lang.addOption(I18nUtil.DEFAULTLOCALE.toString(), I18nUtil.DEFAULTLOCALE.getDisplayName()); lang.setOptionSelected((defaultLanguage == null || defaultLanguage.equals("")) ? I18nUtil.DEFAULTLOCALE.toString() : defaultLanguage); if (!registering && !ConfigurationManager.getBooleanProperty("xmlui.user.editmetadata", true)) lang.setDisabled(); subscriptions.setLabel(T_email_subscriptions); subscriptions.setHelp(""); subscriptions.enableAddOperation(); subscriptions.enableDeleteOperation(); subscriptions.addOption(-1,T_select_collection); for (Collection possible : possibleList) subscriptions.addOption(possible.getID(), name); subscriptions.addInstance().setOptionSelected(collection.getID());
groupSelect.setLabel(T_taskgroup_label_name); groupSelect.setSize(1); groupSelect.setRequired(); groupSelect.setEvtBehavior("submitOnChange"); if (curateGroup.equals("")) groupSelect.setOptionSelected(curateGroup); taskSelect.setLabel(T_task_label_name); taskSelect.setSize(1); taskSelect.setRequired(); if(taskSelected!=null) taskSelect.setOptionSelected(taskSelected);
countdown.setLabel(T_alerts_countdown_label); countdown.addOption(0,T_alerts_countdown_none); countdown.addOption(5,T_alerts_countdown_5); countdown.addOption(15,T_alerts_countdown_15); countdown.addOption(30,T_alerts_countdown_30); countdown.addOption(60,T_alerts_countdown_60); countdown.addOption(true, -1, T_alerts_countdown_keep); countdown.setOptionSelected(0); restrictsessions.setLabel(T_alerts_session_label); restrictsessions.addOption(SystemwideAlerts.STATE_ALL_SESSIONS,T_alerts_session_all_sessions); restrictsessions.addOption(SystemwideAlerts.STATE_CURRENT_SESSIONS,T_alerts_session_current_sessions); restrictsessions.addOption(SystemwideAlerts.STATE_ONLY_ADMINISTRATIVE_SESSIONS,T_alerts_session_only_administrative); restrictsessions.setOptionSelected(SystemwideAlerts.getRestrictSessions());
public static Select getGroupSelectOptions(Select select) throws WingException { Iterator<String> iterator = groups.keySet().iterator(); while (iterator.hasNext()) { String key = iterator.next(); select.addOption(key, groups.get(key)); } return select; }
qual.setDisabled(); value.setDisabled(); qual.addOption(returnValue,display); qual.addInstance().setOptionSelected(dcValue.qualifier); value.addInstance().setValue(dcValue.value); qualdrop.addInstance().setValue(dcValue.qualifier + ":" + dcValue.value); qual.setOptionSelected(dcValues[0].qualifier); value.setValue(dcValues[0].value);
list.addItem().addHidden("button_required"); Select selectList = list.addItem().addSelect("licenseclass_chooser"); selectList.setLabel(T_license); selectList.setEvtBehavior("submitOnChange"); Iterator<CCLicense> iterator = cclookup.getLicenses(ConfigurationManager.getProperty("default.locale")).iterator(); selectList.addOption(T_select_change.getKey(), T_select_change); while (iterator.hasNext()) { CCLicense cclicense = iterator.next(); selectList.addOption(cclicense.getLicenseId(), cclicense.getLicenseName()); if (selectedLicense != null && selectedLicense.equals(cclicense.getLicenseId())) selectList.setOptionSelected(cclicense.getLicenseId()); selectList.addOption(T_no_license.getKey(), T_no_license); if (selectedLicense != null) {
addName.setLabel(T_name_label); MetadataField[] fields = MetadataField.findAll(context); for (MetadataField field : fields) addName.addOption(fieldID, name); addName.setOptionSelected(previousFieldID); mdSelect.setSize(1); Choices cs = cmgr.getMatches(fieldKey, value.value, collectionID, 0, 0, null); if (cs.defaultSelected < 0) mdSelect.addOption(true, value.value, value.value); mdSelect.addOption(i == cs.defaultSelected, cs.values[i].value, cs.values[i].label);
select.setLabel(T_bundle_label); select.setOptionSelected("ORIGINAL"); select.setDisabled();
actionsList.addLabel(T_actions_policyGroup); Select groupSelect = actionsList.addItem().addSelect("group_id"); groupSelect.setMultiple(true); groupSelect.setSize(15); for (Group group : Group.findAll(context, Group.NAME)) groupSelect.addOption(false, group.getID(), group.getName()); for( int i = 0; i < Constants.actionText.length; i++ ) actionSelect.addOption(i, Constants.actionText[i]); actionsList.addLabel(T_actions_policyResource); Select resourceSelect = actionsList.addItem().addSelect("resource_id"); resourceSelect.addOption(true, Constants.ITEM, "item"); resourceSelect.addOption(false, Constants.BITSTREAM, "bitstream"); actionsList.addLabel(T_actions_policyCollections); Select collectionsSelect = actionsList.addItem().addSelect("collection_id"); collectionsSelect.setMultiple(true); collectionsSelect.setSize(15); for (Collection collection : Collection.findAll(context)) collectionsSelect.addOption(false, collection.getID(), collection.getMetadata("name"));
Select metadataFormat = settings.addItem().addSelect("metadata_format"); if (errorMap.containsKey(OAIHarvester.OAI_ORE_ERROR)) { metadataFormat.addError(errorMap.get(OAIHarvester.OAI_ORE_ERROR)); metadataFormat.addError(errorMap.get(OAIHarvester.OAI_DMD_ERROR)); metadataFormat.addOption(metadataKey.equalsIgnoreCase(metadataFormatValue), metadataKey, displayName);