API Overview API Index Package Overview Direct link to this page
JavaOnTracks 0.1.2
  net.jot.web.forms.ui. JOTFormSelectField View Javadoc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89

/*
------------------------------------
JavaOnTracks          Thibaut Colar
tcolar-jot AT colar DOT net
Artistic Licence 2.0
http://www.javaontracks.net
------------------------------------
 */
package net.jot.web.forms.ui;

import net.jot.web.forms.JOTFormConst;

/**
Html Select
@author thibautc
*/
public class JOTFormSelectField extends JOTFormField
{

  protected int size = 1;
  protected String[] possibleValues =  {};
  protected String[] possibleDescriptions =  {};

  protected boolean multiples = false;
        /**

@param name 
@param description 
@param size 
@param possibleValues list of value(s) (option) for the select to show in the html
@param defaultValues  list of value(s) should be selected/highlighted.
*/
public JOTFormSelectField(String name, String description, int size, String[] possibleValues, String[] defaultValues)
  {
    this(name, description, size, possibleValues, possibleValues, defaultValues);
  }

  /**
         * 
         * @param name
         * @param description
         * @param size
         * @param possibleValues list of value(s) (option) for the select to show in the html
         * @param possibleDescriptions the name/description to be chown in the select box.
         * @param defaultValues  list of value(s) should be selected/highlighted.
         */
  public JOTFormSelectField(String name, String description, int size, String[] possibleValues, String[] possibleDescriptions, String[] defaultValues)
  {
    setType(JOTFormConst.SELECT);
    setName(name);
    setDescription(description);
    this.size = size;
    this.possibleValues = possibleValues;
    this.possibleDescriptions = possibleDescriptions;
    if (defaultValues != null)
    {
      this.defaultValue = "";
      for (int i = 0; i != defaultValues.length; i++)
      {
        defaultValue += (i == 0 ? "" : ",") + defaultValues[i];
      }
    }
  }

  public String[] getPossibleDescriptions()
  {
    return possibleDescriptions;
  }

  public String[] getPossibleValues()
  {
    return possibleValues;
  }

  public int getSize()
  {
    return size;
  }

  public void setAllowMultiples(boolean b)
  {
      multiples=b;
  }
  
  public boolean getAllowMultiples()
  {
      return multiples;
  }
}

Generated By: JavaOnTracks Doclet 0.1.5     ©Thibaut Colar