public void fixupComponent() { if (optionnames != null) { if (optionnames.valuebinding == null) { optionnames.valuebinding = optionlist.valuebinding; } } else { throw new IllegalArgumentException("UISelect component with full ID " + getFullID() + " does not have optionnames set"); } selected = computeSelectionSet(selection); }
/** @see #make(UIContainer, String, String[], String[], String, String) */ public static UISelect make(UIContainer tofill, String ID, String[] options, String[] labels, String valuebinding) { return UISelect.make(tofill, ID, options, labels, valuebinding, null); } /**
/** A "skeleton" make method to prepare for more complex constructions */ public static UISelect make(UIContainer tofill, String ID) { UISelect togo = new UISelect(); togo.ID = ID; tofill.addComponent(togo); RSFUtil.updateChildIDs(togo); return togo; }
UISelect yearselect = UISelect.make(togo, "year", yearlist, ttb + "year", transit == null ? null: transit.year); UISelect monthselect = UISelect.make(togo, "month", MonthBean.indexarray, null, ttb + "month", transit == null ? null : transit.month); UISelect dayselect = UISelect.make(togo, "day", daylist, ttb + "day", transit == null ? null : transit.day); UISelect.make(togo, "hour", hourlist, ttb + "hour", transit == null ? null : transit.hour); UISelect.make(togo, "minute", minutelist, ttb + "minute", transit == null ? null : transit.minute); UISelect.make(togo, "ampm", new String[] {"0", "1"}, new String[]{"AM", "PM"}, ttb + "ampm", transit == null ? null : transit.ampm); "chef_dateselectionwidgetpopup('" + yearselect.getFullID() + "-selection', '" + monthselect.getFullID() + "-selection', '" + dayselect.getFullID() + "-selection');");
String[] optionlist = toevolve.optionlist.getValue(); StringSet selhash = UISelect.computeSelectionSet(toevolve.selection); UISelect leftselect = UISelect.makeMultiple(togo, "list1", leftnames.toStringArray(), toevolve.selection.valuebinding.value, null); leftselect.optionlist = UIOutputMany.make(leftvals.toStringArray()); UISelect rightselect = UISelect.makeMultiple(togo, "list2", rightnames.toStringArray(), toevolve.selection.valuebinding.value, null);
UISelect yearselect = UISelect.make(togo, "year", yearlist, ttb + "year", transit == null ? null: transit.year); UISelect monthselect = UISelect.make(togo, "month", MonthBean.indexarray, null, ttb + "month", transit == null ? null : transit.month); UISelect dayselect = UISelect.make(togo, "day", daylist, ttb + "day", transit == null ? null : transit.day); UISelect.make(togo, "hour", hourlist, ttb + "hour", transit == null ? null : transit.hour); UISelect.make(togo, "minute", minutelist, ttb + "minute", transit == null ? null : transit.minute); UISelect.make(togo, "ampm", new String[] {"0", "1"}, new String[]{"AM", "PM"}, ttb + "ampm", transit == null ? null : transit.ampm); "chef_dateselectionwidgetpopup('" + yearselect.getFullID() + "-selection', '" + monthselect.getFullID() + "-selection', '" + dayselect.getFullID() + "-selection');");
String[] optionlist = toevolve.optionlist.getValue(); StringSet selhash = UISelect.computeSelectionSet(toevolve.selection); UISelect leftselect = UISelect.makeMultiple(togo, "list1", leftnames.toStringArray(), toevolve.selection.valuebinding.value, null); leftselect.optionlist = UIOutputMany.make(leftvals.toStringArray()); UISelect rightselect = UISelect.makeMultiple(togo, "list2", rightnames.toStringArray(), toevolve.selection.valuebinding.value, null);
/** * Constructs a single selection control, with labels distinct from the * submitting values. */ public static UISelect make(UIContainer tofill, String ID, String[] options, String[] labels, String valuebinding, String initvalue) { UISelect togo = make(tofill, ID, options, valuebinding, initvalue); if (labels != null) { togo.optionnames = UIOutputMany.make(labels); } return togo; }
protected static UISelect make(UIContainer tofill, String ID, String[] options) { UISelect togo = new UISelect(); togo.ID = ID; togo.optionlist = togo.optionnames = UIOutputMany.make(options); tofill.addComponent(togo); RSFUtil.updateChildIDs(togo); return togo; }
/** * Constructs a single selection control, where the submitted values are * identical with the rendered labels */ public static UISelect make(UIContainer tofill, String ID, String[] options, String valuebinding, String initvalue) { UISelect togo = make(tofill, ID, options); UIInput selection = UIInput.make(valuebinding); if (initvalue != null) { selection.setValue(initvalue); } togo.selection = selection; return togo; }
/** Creates a selection control without a value binding, either * non-submitting, or suitable for use in a GET form */ public static UISelect make(UIContainer tofill, String ID, String[] values, String[] labels, String value, boolean willinput) { UISelect togo = new UISelect(); togo.optionlist = new UIOutputMany(); togo.ID = ID; togo.optionlist.setValue(values); togo.optionnames = new UIBoundList(); togo.optionnames.setValue(labels); togo.selection = new UIBoundString(); if (value != null) { ((UIBoundString) togo.selection).setValue(value); } togo.selection.willinput = willinput; tofill.addComponent(togo); RSFUtil.updateChildIDs(togo); return togo; }
/** * Constructs a multiple selection control, where the submitted values are * identical with the rendered labels. Named differently to allow overload * where the final parameter is null. */ public static UISelect makeMultiple(UIContainer tofill, String ID, String[] options, String valuebinding, String[] initvalue) { UISelect togo = make(tofill, ID, options); UIInputMany selection = UIInputMany.make(valuebinding); if (initvalue != null) { selection.setValue(initvalue); } togo.selection = selection; return togo; }
/** * Constructs a multiple selection control, with distinct submitted values and * rendered labels. */ public static UISelect makeMultiple(UIContainer tofill, String ID, String[] options, String[] labels, String valuebinding, String[] initvalue) { UISelect togo = make(tofill, ID, options); UIInputMany selection = UIInputMany.make(valuebinding); if (initvalue != null) { selection.setValue(initvalue); } if (labels != null) { togo.optionnames = UIOutputMany.make(labels); } togo.selection = selection; return togo; }
String[] labels = new String[] { "Show 5", "Show 10", "Show 20", "Show 50", "Show 100", "Show 200" }; UISelect.make(joint, "num-pages-select", values, labels, options.acquirePageSize(20)+"", false);
String[] labels = new String[] { "Show 5", "Show 10", "Show 20", "Show 50", "Show 100", "Show 200" }; UISelect.make(joint, "num-pages-select", values, labels, options.acquirePageSize(20)+"", false);