01: /*
02: * Created on Jan 16, 2006
03: */
04: package uk.org.ponder.rsf.components;
05:
06: /** Represents the input of multiple String values from the UI. Note that this
07: * component cannot be represented directly in HTML - it may be used either as
08: * the "selection" member of a multiple selection control, or passed as the
09: * argument to a fuller Evolver.
10: * @author Antranig Basman (antranig@caret.cam.ac.uk)
11: *
12: */
13:
14: public class UIInputMany extends UIBoundList {
15: public UIInputMany() {
16: fossilize = true;
17: willinput = true;
18: }
19:
20: /**
21: * A "bare" constructor suitable for the selection member of a multiple
22: * selection control (UIInput);
23: */
24: public static UIInputMany make(String valuebinding) {
25: UIInputMany togo = new UIInputMany();
26: togo.valuebinding = new ELReference(valuebinding);
27: return togo;
28: }
29:
30: /** A full constructor, specifying a bound String array with an optional
31: * initial value. Note that there is no direct renderer for such a component
32: * in HTML.
33: */
34: public static UIInputMany make(UIContainer parent, String ID,
35: String binding, String[] initvalue) {
36: UIInputMany togo = new UIInputMany();
37: togo.valuebinding = ELReference.make(binding);
38: if (initvalue != null) {
39: togo.setValue(initvalue);
40: }
41: togo.ID = ID;
42: parent.addComponent(togo);
43: return togo;
44: }
45:
46: /** @see #make(UIContainer, String, String, String[]) */
47:
48: public static UIInputMany make(UIContainer parent, String ID,
49: String binding) {
50: return make(parent, ID, binding, null);
51: }
52: }
|