git-svn-id: https://samskivert.googlecode.com/svn/trunk@1581 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user