/** * 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. * @return a new select field */ public Select addSelect(String name) throws WingException { return addSelect(name, null); }
/** * Add a single-line text input control. * * @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. * @return a new text field */ public Text addText(String name) throws WingException { return addText(name, null); }
/** * Add a boolean input control which may be toggled by the user. Multiple * radio button fields may share the same name. When this occurs only one * field may be selected to be true. This is distinct from a checkbox where * multiple fields may be toggled. * * @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. * * @return a new radio field */ public Radio addRadio(String name) throws WingException { return addRadio(name, null); }
Select qual = qualdrop.addSelect(fieldName+"_qualifier"); Text value = qualdrop.addText(fieldName+"_value"); qualdrop.setLabel(dcInput.getLabel()); qualdrop.setHelp(cleanHints(dcInput.getHints())); if (dcInput.isRequired()) qualdrop.setRequired(); qualdrop.addError(dcInput.getWarning()); qualdrop.addError(T_required_field); qualdrop.enableAddOperation(); qualdrop.enableDeleteOperation(); qualdrop.setDisabled(); qual.setDisabled(); value.setDisabled(); qualdrop.addInstance().setValue(dcValue.qualifier + ":" + dcValue.value);
Text lastName = fullName.addText(fieldName+"_last"); Text firstName = fullName.addText(fieldName+"_first"); fullName.setLabel(dcInput.getLabel()); fullName.setHelp(cleanHints(dcInput.getHints())); if (dcInput.isRequired()) fullName.setRequired(); fullName.addError(dcInput.getWarning()); fullName.addError(T_required_field); fullName.enableAddOperation(); fullName.enableDeleteOperation(); fullName.setAuthorityControlled(); fullName.setAuthorityRequired(MetadataAuthorityManager.getManager().isAuthorityRequired(fieldKey)); fullName.setChoices(fieldKey); fullName.setChoicesPresentation(ChoiceAuthorityManager.getManager().getPresentation(fieldKey)); fullName.setChoicesClosed(ChoiceAuthorityManager.getManager().isClosed(fieldKey)); fullName.setDisabled(); Instance fi = fullName.addInstance(); fi.setValue(dcValue.value); if (isAuthorityControlled)
composite.setLabel("Composite (two text fields)"); if (help) composite.setHelp("I am the help for the entire composite"); composite.addError("Just the composite is in error"); text = composite.addText("partA"); text.setLabel("Part A"); text.setValue("Value for part A"); text = composite.addText("partB"); text.setLabel("Part B"); text.setValue("Value for part B"); composite.setLabel("Composite (select & text fields)"); if (help) composite.setHelp("This field is composed of a select and text field, select one and type the other."); select = composite.addSelect("selectB"); select.setLabel("Numbers"); if (help) text = composite.addText("TextB"); text.setLabel("Spanish Numbers"); if (help) composite.setLabel("Composite (date)");
filterComp.setLabel(T_add_filter); filterComp.setHelp(T_filter_help); Select select = filterComp.addSelect("filtertype"); filterComp.addText("filter").setSize(30); filterComp.enableAddOperation();
addComposite.setLabel(T_value_label); TextArea addValue = addComposite.addTextArea("value"); Text addLang = addComposite.addText("language");
Radio oaiSetSettingRadio = oaiSetComp.addRadio("oai-set-setting"); oaiSetSettingRadio.addOption("all".equals(oaiSetIdValue) || oaiSetIdValue == null, "all", "All sets"); oaiSetSettingRadio.addOption(!"all".equals(oaiSetIdValue) && oaiSetIdValue != null, "specific", "Specific sets"); Text oaiSetId = oaiSetComp.addText("oai_setid"); oaiSetId.setSize(40); if(!"all".equals(oaiSetIdValue) && oaiSetIdValue != null)
/** * Add a multi-line text input control. * * @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. * @return a new text area field */ public TextArea addTextArea(String name) throws WingException { return addTextArea(name, null); }
/** * Add a boolean input control which may be toggled by the user. A checkbox * may have several fields which share the same name and each of those * fields may be toggled independently. This is distinct from a radio button * where only one field may be toggled. * * @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. * @return A new checkbox field */ public CheckBox addCheckBox(String name) throws WingException { return addCheckBox(name, null); }
/** * Add a composite input control. Composite controls are composed of multiple * individual input controls that combine to form a single value. Example, a * composite field might be used to represent a name which is broken up into * first and last names. In this case there would be a composite field that * consists of two text fields. * * @param name * (Required) a non-unique local identifier used to differentiate * the element from its siblings within an interactive division. * @param rend * (May be null) a rendering hint used to override the default * display of the element. * @return a new composite field. */ public Composite addComposite(String name, String rend) throws WingException { Composite composite = new Composite(context, name, rend); contents.add(composite); return composite; }
Text series = fullSeries.addText(fieldName+"_series"); Text number = fullSeries.addText(fieldName+"_number"); fullSeries.setLabel(dcInput.getLabel()); fullSeries.setHelp(cleanHints(dcInput.getHints())); if (dcInput.isRequired()) fullSeries.setRequired(); fullSeries.addError(dcInput.getWarning()); fullSeries.addError(T_required_field); fullSeries.enableAddOperation(); fullSeries.enableDeleteOperation(); fullSeries.setDisabled(); series.setDisabled(); number.setDisabled(); fullSeries.addInstance().setValue(dcSeriesNumber.toString());
p.addContent("This is a 'Composite' field of two text fields, "); Composite composite = p.addComposite("composite-2text"); composite.setLabel("Composite (two text fields)"); if (help) composite.setHelp("I am the help for the entire composite"); composite.addError("Just the composite is in error"); text = composite.addText("partA"); text.setLabel("Part A"); text.setValue("Value for part A"); text = composite.addText("partB"); text.setLabel("Part B"); text.setValue("Value for part B");
Text year = fullDate.addText(fieldName+"_year"); Select month = fullDate.addSelect(fieldName+"_month"); Text day = fullDate.addText(fieldName+"_day"); fullDate.setLabel(dcInput.getLabel()); fullDate.setHelp(cleanHints(dcInput.getHints())); if (dcInput.isRequired()) fullDate.setRequired(); fullDate.addError(dcInput.getWarning()); fullDate.addError(T_required_field); fullDate.enableAddOperation(); fullDate.enableDeleteOperation(); month.addInstance().setOptionSelected(dcDate.getMonth()); day.addInstance().setValue(String.valueOf(dcDate.getDay())); fullDate.addInstance().setValue(dcDate.toString());
composite.setLabel("Composite (two text fields)"); composite.enableAddOperation(); composite.enableDeleteOperation(); if (help) composite.setHelp("This field is composed of two text fields, fill them both in."); composite.addError("Just the composite is in error."); text = composite.addText("firstA"); if (help) text = composite.addText("secondA"); if (help) composite.setLabel("Composite (select & text fields)"); composite.enableAddOperation(); composite.enableDeleteOperation(); if (help) composite.setHelp("This field is composed of a select and text field, select one and type the other."); select = composite.addSelect("selectB"); if (help) text = composite.addText("TextB"); if (help) composite.addInstance().setInterpretedValue("One interpreted.");