git-svn-id: https://samskivert.googlecode.com/svn/trunk@1581 6335cc39-0255-0410-8fd6-9bcaacd3b74c

This commit is contained in:
mdb
2005-01-25 22:33:55 +00:00
parent 811d8700de
commit f07c9f1ac3
@@ -286,10 +286,20 @@ public class FormTool
*/
public String option (
String name, String value, String item, Object defaultValue)
{
String selectedValue = getValue(name, defaultValue);
return fixedOption(name, value, item, selectedValue);
}
/**
* Constructs an option entry for a select menu with the specified
* name, value, item, and selected value.
*/
public String fixedOption (
String name, String value, String item, Object selectedValue)
{
StringBuffer buf = new StringBuffer();
buf.append("<option value=\"").append(value).append("\"");
String selectedValue = getValue(name, defaultValue);
if (selectedValue.equals(value)) {
buf.append(" selected");
}