public abstract class PulldownList extends Object
Modifier and Type | Field and Description |
---|---|
protected DatabaseProperties |
data
Object containing database connection properties.
|
Constructor and Description |
---|
PulldownList() |
Modifier and Type | Method and Description |
---|---|
protected ResultSet |
buildResultSet()
Creates result set that is used to generate select tag.
|
protected abstract ResultSet |
buildResultSet(String selector)
Creates result set that is used to generate select tag.
|
protected String |
getText(ResultSet rs,
String selector)
Determine text value for the option
|
protected String |
getValue(ResultSet rs,
String selector)
Determine the value for option
|
protected String |
initialOption()
Used to generate initial option in select tag.
|
String |
multipleRequest(String name)
Generate the HTML code for a SELECT tag that
allows multiple values to be selected.
|
String |
multipleRequest(String name,
String[] values)
Generate the HTML code for a SELECT tag that
allows multiple values to be selected.
|
String |
multipleRequest(String name,
String[] values,
String selector,
String attributes)
Generate the HTML code for a SELECT tag that
allows multiple values to be selected.
|
String |
singleRequest(String name)
Generate the HTML code for a SELECT tag
that allows a single value to be selected.
|
String |
singleRequest(String name,
String value)
Generate the HTML code for a SELECT tag
that allows a single value to be selected.
|
String |
singleRequest(String name,
String value,
String selector,
String attributes)
Generate the HTML code for a SELECT tag
that allows a single value to be selected.
|
protected DatabaseProperties data
The value should be set by the constructor.
public PulldownList()
protected abstract ResultSet buildResultSet(String selector)
selector
- Option value that can be used to control generation of tagprotected String initialOption()
public String singleRequest(String name, String value, String selector, String attributes) throws SQLException
name
- Name attribute for SELECT tagvalue
- Existing value for selectorselector
- Option to be used in creating HTML codeattributes
- Code for additional attributes for SELECT tagSQLException
public String multipleRequest(String name, String[] values, String selector, String attributes) throws SQLException
name
- Name attribute for SELECT tagvalues
- Existing values for items in tagselector
- Option to be used in creating HTML codeattributes
- Additional attributes for SELECT tagSQLException
protected String getValue(ResultSet rs, String selector) throws SQLException
rs
- Result set containing information for menuselector
- Optional selector for controlling HTML generationSQLException
protected String getText(ResultSet rs, String selector) throws SQLException
rs
- Result set containing informationselector
- Optional selector for controlling HTML generationSQLException
protected ResultSet buildResultSet() throws SQLException
SQLException
public String singleRequest(String name) throws SQLException
name
- Name attribute for SELECT tagSQLException
public String singleRequest(String name, String value) throws SQLException
name
- Name attribute for SELECT tagvalue
- Existing value for selectorSQLException
public String multipleRequest(String name) throws SQLException
name
- Name attribute for SELECT tagSQLException
public String multipleRequest(String name, String[] values) throws SQLException
name
- Name attribute for SELECT tagvalues
- Existing values for items in tagSQLException