【发布时间】:2014-09-03 10:29:42
【问题描述】:
我有一个如下所示的下拉菜单:
<html:select styleId="colorCodeId" property="msSpec.colorcodeId" name="Form" styleClass="form-control">
<option value="-1"></option>
<html:optionsCollection property="colorcodeList" style="background: <%=test1%>;"/>
</html:select>
在 Java 代码中我有:
List<LabelValueBean> colorcodeList = new ArrayList<LabelValueBean>();
for (Mty property : customPropertyList) {
LabelValueBean bean = new LabelValueBean(property.getName(), property.getId().toString());
if (property instanceof ColorCode) {
test1 = property.getName();
System.out.println("test1: " + test1);
colorcodeList.add(bean);
}
}
我是否可以像上面一样定义test1 并将其用作下拉菜单中的背景颜色?现在不行。
【问题讨论】: