我想在进入页面时默认显示下拉框的年份和季度是当前的年份和季度 用的是struts1框架
我在Action里已经给form设好值了
具体页面代码是这样的
<tr height="40">
<td><bean:message key="kpi.contentmanager.year"/></td>
<td>
<html:select property="year" size="1" style="width:152px">
<html:options collection="yearcollection" property="value" labelProperty="label"/>
</html:select>
</td>
</tr>
<tr height="40">
<td><bean:message key="kpi.contentmanager.quarter"/></td>
<td>
<html:select property="quarter" size="1" styleId="select2" style="width:152px">
<html:option value="Q1"><bean:message key="kpi.contentmanager.quarter1"/></html:option>
<html:option value="Q2"><bean:message key="kpi.contentmanager.quarter2"/></html:option>
<html:option value="Q3"><bean:message key="kpi.contentmanager.quarter3"/></html:option>
<html:option value="Q4"><bean:message key="kpi.contentmanager.quarter4"/></html:option>
</html:select>
<bean:write name="kpiprocessform" property="quarter"/>
<bean:write name="kpiprocessform" property="year"/>
</td>
</tr>
通过bean write已经在页面上打印出当前的年份和季度了 可是下拉框的还是不会变 我之前几个下拉框都是这么做的,都可以啊,这个不知道为什么就不行了~
我在Action里已经给form设好值了
具体页面代码是这样的
<tr height="40">
<td><bean:message key="kpi.contentmanager.year"/></td>
<td>
<html:select property="year" size="1" style="width:152px">
<html:options collection="yearcollection" property="value" labelProperty="label"/>
</html:select>
</td>
</tr>
<tr height="40">
<td><bean:message key="kpi.contentmanager.quarter"/></td>
<td>
<html:select property="quarter" size="1" styleId="select2" style="width:152px">
<html:option value="Q1"><bean:message key="kpi.contentmanager.quarter1"/></html:option>
<html:option value="Q2"><bean:message key="kpi.contentmanager.quarter2"/></html:option>
<html:option value="Q3"><bean:message key="kpi.contentmanager.quarter3"/></html:option>
<html:option value="Q4"><bean:message key="kpi.contentmanager.quarter4"/></html:option>
</html:select>
<bean:write name="kpiprocessform" property="quarter"/>
<bean:write name="kpiprocessform" property="year"/>
</td>
</tr>
通过bean write已经在页面上打印出当前的年份和季度了 可是下拉框的还是不会变 我之前几个下拉框都是这么做的,都可以啊,这个不知道为什么就不行了~
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货