幫忙看下這種程式,如何能實現下拉選單的方式!

yekong發表於2004-11-05
package org.jbpm.workflow.delegation.impl.htmlformatter;

import java.text.ParseException;
import javax.servlet.http.HttpServletRequest;
import org.jbpm.workflow.delegation.*;

/**
* @author Tom Baeyens
*/
public class TextInput extends AbstractConfigurable implements HtmlFormatter {

public String objectToHtml( Object value, String parameterName, HttpServletRequest request) {
String html = null;

String size = "10";

if ( getConfiguration().containsKey("size") ) {
size = (String) getConfiguration().get("size");
}

String text = "";
if ( value != null ) text = (String) value;

html = "<input type=text size=" + size + " name=\"" + parameterName + "\" value=\"" + text + "\">";

return html;
}

public Object parseHttpParameter( String text, HttpServletRequest request ) throws ParseException {
return text;
}
}

相關文章