/** * Add an option. * * @param selected * (Required) Set the option is checked * @param returnValue * (Required) The value to be passed back if this option is * checked. */ public Option addOption(boolean selected, String returnValue) throws WingException { if (selected) { setOptionSelected(returnValue); } return addOption(returnValue); }
/** * 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. * @param rend * (May be null) a rendering hint used to override the default * display of the element. * @return a new checkbox field */ public CheckBox addCheckBox(String name, String rend) throws WingException { CheckBox checkbox = new CheckBox(context, name, rend); contents.add(checkbox); return checkbox; }
multipleTitles.setLabel(T_multiple_titles); multipleTitles.setHelp(T_multiple_titles_help); multipleTitles.addOption("true"); if (submission.hasMultipleTitles()) multipleTitles.setOptionSelected("true"); publishedBefore.setLabel(T_published_before); publishedBefore.setHelp(T_published_before_help); publishedBefore.addOption("true"); if (submission.isPublishedBefore()) publishedBefore.setOptionSelected("true");
if (help) checkBox.setHelp("Select either yes or no."); checkBox.addError("You are incorrect, try again."); checkBox.setLabel("Yes or no"); checkBox.addOption("yes"); p.addContent(", embedded in a paragraph."); if (help) checkBox.setHelp("Select all the fruits that you like to eat"); checkBox.addError("You are incorrect you actualy do like Tootse Rolls."); checkBox.setLabel("fruits"); checkBox.addOption("apple","Apples"); checkBox.addOption(true,"orange","Oranges"); checkBox.addOption("pear","Pears"); checkBox.addOption("tootsie","Tootsie Roll"); checkBox.addOption(true,"cherry","Cherry"); p.addContent(", embedded in a paragraph.");
optionsField.setLabel("Options"); optionsField.addOption("blankLines", "Treat blank lines as paragraph breaks."); if (blankLines) optionsField.setOptionSelected("blankLines");
selectEPerson.setLabel(epersonID); selectEPerson.addOption(epersonID); if (deleteConstraints != null && deleteConstraints.size() > 0) selectEPerson.setDisabled();
/** * Add an option. * * @param returnValue * (Required) The value to be passed back if this option is * selected. */ public Option addOption(int returnValue) throws WingException { return addOption(String.valueOf(returnValue)); }
if (help) checkBox.setHelp("Select all the fruits that you like to eat"); checkBox.addError("You are incorrect you actualy do like Tootse Rolls."); checkBox.setLabel("fruits"); checkBox.addOption("apple","Apples"); checkBox.addOption(true,"orange","Oranges"); checkBox.addOption("pear","Pears"); checkBox.addOption("tootsie","Tootsie Roll"); checkBox.addOption(true,"cherry","Cherry"); intrest.setLabel("Intrests"); if (help) intrest.setHelp("Select all topics which are of intrests to you."); intrest.addError("You're intrests are in error?"); intrest.addOption("DL","Digital Libraries"); intrest.addOption("HT","Hypertexts"); intrest.addOption("IM","Information Managment"); intrest.addOption("ID","Information Discovery"); intrest.addOption("SI","Social Impact");
remove.setLabel("remove"); remove.addOption(bundle.getID() + "/" + bitstream.getID()); if (!AuthorizeManager.authorizeActionBoolean(context, item, Constants.REMOVE)) { remove.setDisabled();
/** * Add an option. * * @param returnValue * (Required) The value to be passed back if this option is * checked. * @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 an option. * * @param selected * (Required) Set the option is checked * @param returnValue * (Required) The value to be passed back if this option is * checked. * @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); }
/** * Add an 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 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. * @param rend * (May be null) a rendering hint used to override the default * display of the element. * @return a new checkbox field */ public CheckBox addCheckBox(String name, String rend) throws WingException { CheckBox checkbox = new CheckBox(context, name, rend); fields.add(checkbox); return checkbox; }