我的数据是 List<List<Shift>> defaultShiftTime;现在我要获取所有的 defaultShiftTime.get(i).get(0).hours请问如何实现?
下面这个例子不行<nested:iterate id="shiftTime" name="permanagerForm" property="defaultShiftTime" indexId="index">
<html:text property='hours' name="shiftTime[0]" indexed="true"/>
</nested:iterate>错误提示 javax.servlet.jsp.JspException: Cannot find bean shiftTime[0] in any scope
下面这个例子不行<nested:iterate id="shiftTime" name="permanagerForm" property="defaultShiftTime" indexId="index">
<html:text property='hours' name="shiftTime[0]" indexed="true"/>
</nested:iterate>错误提示 javax.servlet.jsp.JspException: Cannot find bean shiftTime[0] in any scope
判断你要的第一个就行了
<nested:iterate id="shiftTime" name="permanagerForm" property="defaultShiftTime" indexId="index">
<html:select name="shiftTime[0]" property="pkid" indexed="true">
<html:options collection="shiftTime" labelProperty="description" property="pkid"/>
</html:select>
<html:text property='hours' name="shiftTime[0]" indexed="true"/>
</nested:iterate>List <List <Shift>> defaultShiftTime;
前面下拉表里装有 defaultShiftTime.get(i),默认值为defaultShiftTime.get(i).get(0).pkid
后面默认值是 defaultShiftTime.get(i).get(0).hours
以后还要加入ajax,当前面下拉表数值onchange时,修改后面text的值
<nested:iterate id="shift" name="permanagerForm" property='<%= "defaultShiftTime[" + i + "]" %>' indexId="j">
<logic:equal name="j" value="0">
<html:select property="pkid" name="shift" indexed="true">
<html:options collection="shiftTime" labelProperty="description" property="pkid"/>
</html:select>
<html:text property='hours' name="shift" indexed="true"/>
</logic:equal>
</nested:iterate>
</nested:iterate>写了个这样的,还能用,谢谢提示