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); }
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; }
/** * Add a select option. * * @param returnValue * (Required) The value to be passed back if this option is * selected. * @param message * (Required) The transalted text to set as the visible option. */ public void addOption(String returnValue, Message message) throws WingException { Option option = this.addOption(returnValue); option.addContent(message); }
/** * Add a select option. * * @param returnValue * (Required) The value to be passed back if this option is * selected. * @param characters * (Required) The text to set as the visible option. */ public void addOption(String returnValue, String characters) throws WingException { Option option = this.addOption(returnValue); option.addContent(characters); }
/** * Add a select option. * * @param returnValue * (Required) The value to be passed back if this option is * selected. * @param characters * (Required) The text to set as the visible option. */ public void addOption(int returnValue, String characters) throws WingException { Option option = this.addOption(String.valueOf(returnValue)); option.addContent(characters); }
/** * Add a select option. * * @param returnValue * (Required) The value to be passed back if this option is * selected. * @param message * (Required) The transalted text to set as the visible option. */ public void addOption(int returnValue, Message message) throws WingException { Option option = this.addOption(String.valueOf(returnValue)); option.addContent(message); }
/** * 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); }
/** * 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. * @param characters * (Required) The text to set as the visible option. */ public void addOption(boolean selected, int returnValue, String characters) throws WingException { if (selected) { setOptionSelected(returnValue); } addOption(returnValue,characters); }
/** * 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. * @param message * (Required) The transalted text to set as the visible option. */ public void addOption(boolean selected, String returnValue, Message message) throws WingException { if (selected) { setOptionSelected(returnValue); } addOption(returnValue,message); }
/** * 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. * @param message * (Required) The transalted text to set as the visible option. */ public void addOption(boolean selected, int returnValue, Message message) throws WingException { if (selected) { setOptionSelected(returnValue); } addOption(returnValue,message); }
/** * 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. * @param characters * (Required) The text to set as the visible option. */ public void addOption(boolean selected,String returnValue, String characters) throws WingException { if (selected) { setOptionSelected(returnValue); } addOption(returnValue,characters); }
/** * Build a conjunction field in the given for the given cell. A * conjunction consists of logical the operators AND, OR, NOT. * * @param row The current row * @param cell The current cell */ private void buildConjunctionField(int row, Cell cell) throws WingException { // No conjunction for the first row. if (row == 1) { return; } Request request = ObjectModelHelper.getRequest(objectModel); String current = request.getParameter("conjunction" + row); // default to AND if nothing specified. if (current == null || current.length() == 0) { current = "AND"; } Select select = cell.addSelect("conjunction" + row); select.addOption("AND".equals(current), "AND").addContent(T_and); select.addOption("OR".equals(current), "OR").addContent(T_or); select.addOption("NOT".equals(current), "NOT").addContent(T_not); }
if (scopeDSO == null) { scope.addOption("/", T_all_of_dspace); scope.setOptionSelected("/"); for (Community community : Community.findAllTop(context)) { scope.addOption(community.getHandle(), community.getMetadata("name")); scope.addOption("/", T_all_of_dspace); scope.addOption(community.getHandle(), community.getMetadata("name")); scope.setOptionSelected(community.getHandle()); scope.addOption(collection.getHandle(), collection.getMetadata("name")); scope.addOption("/", T_all_of_dspace); scope.addOption(collection.getHandle(), collection.getMetadata("name")); scope.setOptionSelected(collection.getHandle()); .getAllParents(); for (Community community : communities) { scope.addOption(community.getHandle(), community.getMetadata("name"));
protected void buildSearchControls(Division div) throws WingException, SQLException { Request request = ObjectModelHelper.getRequest(objectModel); Table controlsTable = div.addTable("search-controls", 1, 3); Row controlsRow = controlsTable.addRow(Row.ROLE_DATA); // Create a control for the number of records to display Cell rppCell = controlsRow.addCell(); rppCell.addContent("pagesize"); Select rppSelect = rppCell.addSelect("rpp"); for (int i : RESULTS_PER_PAGE_PROGRESSION) { rppSelect.addOption((i == getParameterRpp()), i, Integer.toString(i)); } Cell filterCell = controlsRow.addCell(); // Create a drop down of the different sort columns available int selectedCollectionId = Util.getIntParameter(request, "filter_collection"); filterCell.addContent("Collection filter:"); Select sortSelect = filterCell.addSelect("filter_collection"); sortSelect.addOption(-1 == selectedCollectionId,-1, "None"); Collection[] collections = Collection.findAll(context); for (Collection collection : collections) { sortSelect.addOption(collection.getID() == selectedCollectionId, collection.getID(), collection.getName()); } controlsRow.addCell().addButton("submit_search_controls").setValue(T_go); }
select.addOption(bundleName, message("xmlui.administrative.item.AddBitstreamForm.bundle." + bundleName)); return true;
@Override public void addBody(Body body) throws SAXException, WingException, SQLException, IOException, AuthorizeException { Item item = workflowItem.getItem(); Collection collection = workflowItem.getCollection(); Request request = ObjectModelHelper.getRequest(objectModel); String actionURL = contextPath + "/handle/"+collection.getHandle() + "/xmlworkflow"; Division div = body.addInteractiveDivision("perform-task", actionURL, Division.METHOD_POST, "primary workflow"); div.setHead(T_HEAD); addWorkflowItemInformation(div, item, request); Para scorePara = div.addPara(); scorePara.addContent(T_score_help); Select scoreSelect = scorePara.addSelect("score"); for(int i = 0; i <= 100; i+=10){ scoreSelect.addOption(i, i + "%"); } scorePara.addButton("submit_score").setValue(T_score_button); div.addPara().addButton("submit_leave").setValue(T_cancel_submit); div.addHidden("submission-continue").setValue(knot.getId()); } }