0

我正在使用jsp 中迭代的每一行迭代一个列表logic:iterate,我们需要为名为 dateOfDetection 的字段提供日期选择器。logic:iterate

参考代码:

<logic:iterate  id="dbOject"   name="fakeNotesListInSession" scope="session"
indexId="tableCounter"> 

<TR >
<TD> <html:text name="dbOject" property="dateOfDetection"   readonly="true" size="10" ></html:text>
<img src="web/images/cal[2].gif" id="trigger<%=tableCounter.toString()%>" alt="Calendar"/> 
<script type="text/javascript">

                     Calendar.setup({

                           inputField : "dateOfDetection", 

                           ifFormat : "%d/%m/%Y", 

                           button : "trigger<%=tableCounter.toString()%>" 
                     });

                   </script></TD>

         <TD> <html:text name="dbOject" property="fives"  size = "5"  ></html:text></TD>

         <TD> <html:text name="dbOject" property="tens"  size = "5"  ></html:text></TD>


           </TR>

 </logic:iterate>

对于它正在迭代的每一行,日期选择器即将到来,但是当我们选择日期值时,它仅将值设置为第一行。原因是“在 Calendar.setup 函数中,我们将 inputField 指定为“dateOfDetection”。这被定义为 String dateOfDetection[]=null; 在 action 表单中,因此可以在 action claas 中将其作为数组获取。

4

0 回答 0