$B@uLn$H?=$7$^$9!#(B<div>$B$*@$OC$K$J$j$^$9!#(B</div><div><br></div><div>JavaScript$B$G9TDI2C$9$k(BxxxItems$B$G!"(BSubapplicationScope$B$K;XDj$7$F$$$k>l9g$G$9$,!"C1BN$N(BHTML$B$G$O9TDI2C$,(BxxxItems$B$N%5%$%:$KH?1G$5$l$k$N$G$9$,!"%l%$%"%&%H(BHTML$B$rE,MQ$9$k$HDI2C9T$,H?1G$5$l$J$/$J$C$F$7$^$$$^$7$?!#(B</div><div>$B0J2<$K%5%s%W%k%=!<%9$r5-=R$7$^$9$,!"$I$3$,$*$+$7$$$+J,$+$j$^$9$G$7$g$&$+!)(B</div>
<div><br></div><div>$B4D6-$O(B</div><div>$B!!(BSeasar2:2.4.33</div><div>$B!!(BTeeda:1.0.13(sp4)<br></div><div>$B$K$J$j$^$9!#(B</div><div><br></div><div>$B$h$m$7$/$*4j$$$$$?$7$^$9!#(B</div><div><br></div><div><br></div><div>------------------$B!J%5%s%W%k(B START$B!K(B----------------------------</div>
<div>$B!Z%a%$%s$N(BHTML$B![(B</div><div><div><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>"></div>
<div><html xmlns="<a href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</a>" xmlns:te="<a href="http://www.seasar.org/teeda/extension">http://www.seasar.org/teeda/extension</a>" lang="ja" xml:lang="ja"></div>
<div><head></div><div><span class="Apple-tab-span" style="white-space:pre">        </span><meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /></div><div><span class="Apple-tab-span" style="white-space:pre">        </span><script type="text/javascript" src="jquery-1.2.6.js"></script></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span><script type="text/javascript"></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>function addRow() {</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>var rowStr = '<tr>';</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>rowStr += '<td><span id="rowno"></span></td>';</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>rowStr += '<td><input id="userId" type="text" /></td>';</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>rowStr += '<td><input type="hidden" id="rowno-1" /></td>';</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>rowStr += '</tr>';</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>$('#userItems').append(rowStr);</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span></div><div><span class="Apple-tab-span" style="white-space:pre">                        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>// $BL@:Y$N(BINDEX$B$r?6$jD>$9(B</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>resetIndex();</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>}</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>// $BL@:Y$N(BINDEX$B$r?6$jD>$9(B</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>function resetIndex(){</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>var nameVal = 'form:userItems:';</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>$('#userItems tr').each(function(idx, obj){</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                </span>// $B9THV9f$r?6$jD>$9(B</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>$(obj).find('#rowno').text('' + (idx + 1));</div><div>
<span class="Apple-tab-span" style="white-space:pre">                                </span>// name$BB0@-$N(Bindex$B$r?6$j$J$*$9(B</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>$(obj).find('#rowno').attr('name', nameVal + idx + ':rowno');</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                </span>$(obj).find('#userId').attr('name', nameVal + idx + ':userId');</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>$(obj).find('#rowno-1').attr('name', nameVal + idx + ':rowno-1');</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>});</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></script></div>
<div></head></div><div><body></div><div><span class="Apple-tab-span" style="white-space:pre">        </span><span id="allMessages"/></div><div><span class="Apple-tab-span" style="white-space:pre">        </span><form id="form"></div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span><table></div><div><span class="Apple-tab-span" style="white-space:pre">                        </span><thead></div><div><span class="Apple-tab-span" style="white-space:pre">                                </span><th>$B%f!<%6(BID</th></div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span></thead></div><div><span class="Apple-tab-span" style="white-space:pre">                        </span><tbody id="userItems"></div><div><span class="Apple-tab-span" style="white-space:pre">                                </span><tr></div>
<div><span class="Apple-tab-span" style="white-space:pre">                                        </span><td><span id="rowno"></span></td></div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span><td><input id="userId" type="text" value="" /></td></div>
<div><span class="Apple-tab-span" style="white-space:pre">                                        </span><input type="hidden" id="rowno-1"/></div><div><span class="Apple-tab-span" style="white-space:pre">                                </span></tr></div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span></tbody></div><div><span class="Apple-tab-span" style="white-space:pre">                </span></table></div><div><span class="Apple-tab-span" style="white-space:pre">                </span><input type="button" onclick="addRow()" value="ADD ROW"/></div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span><input type="button" id="doTest" value="TEST"/><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span></form></div>
<div></body></div><div></html></div><div><br></div><div><br></div><div>$B!Z%l%$%"%&%H(BHTML$B![(B</div><div><div><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>"></div>
<div><html xmlns="<a href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</a>" xmlns:te="<a href="http://www.seasar.org/teeda/extension">http://www.seasar.org/teeda/extension</a>" lang="ja" xml:lang="ja"></div>
<div><head></div><div><span class="Apple-tab-span" style="white-space:pre">        </span><meta http-equiv="Content-type" content="text/html; charset=UTF-8" /></div><div><span class="Apple-tab-span" style="white-space:pre">        </span><title>$B%l%$%"%&%H(B</title></div>
<div></head></div><div><body></div><div><span class="Apple-tab-span" style="white-space:pre">        </span><te:includeChildBody id="includeChildBody"/></div><div></body></div><div></html></div>
<div><br></div><div><br></div><div>$B!Z(BPage$B%/%i%9![(B</div><div><div>package sample.web.common;</div><div><br></div><div>import java.sql.Timestamp;</div><div>import java.util.ArrayList;</div><div>import java.util.Date;</div><div>import java.util.List;</div>
<div>import org.seasar.teeda.extension.annotation.scope.SubapplicationScope;</div><div>import sample.dto.UserDto;</div><div><br></div><div>public class IndexPage {</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>@SubapplicationScope</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>public List<UserDto> userItems;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>public int userIndex;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>public String rowno;<span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>public String userId;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div>//<span class="Apple-tab-span" style="white-space:pre">        </span>public Class getLayout() {</div>
<div>//<span class="Apple-tab-span" style="white-space:pre">                </span>return null;</div><div>//<span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>public Class doTest() {</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>System.out.println("doTest size=" + userItems.size());</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>return null;<br>
</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>public Class initialize() {</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>Date today = new Date();</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>userItems = new ArrayList<UserDto>();</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>UserDto user1 = new UserDto();</div><div>
<span class="Apple-tab-span" style="white-space:pre">                </span>user1.timesp = new Timestamp(today.getTime());</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>user1.rowno = "1";</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>user1.userId = "A001";</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>user1.userName = "USER A";</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>userItems.add(user1);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>UserDto user2 = new UserDto();</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>user2.timesp = new Timestamp(today.getTime());</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>user2.rowno = "2";</div><div>
<span class="Apple-tab-span" style="white-space:pre">                </span>user2.userId = "B001";</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>user2.userName = "USER B";</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>userItems.add(user2);</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>return null;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>public Class prerender() {</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>return null;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div>}<br></div><div><br></div><div><br></div><div>$B!Z(BxxxItems$B$G;HMQ$7$F$$$k(BDTO$B![(B</div>
<div><div>package sample.dto;</div><div><br></div><div>import java.io.Serializable;</div><div>import java.sql.Timestamp;</div><div><br></div><div>public class UserDto implements Serializable {</div><div><span class="Apple-tab-span" style="white-space:pre">        </span><br>
</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>private static final long serialVersionUID = 1L;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>public Timestamp timesp;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>public String rowno;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>public String userId;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>public String userName;</div>
<div><br></div><div>}</div><div><br></div></div><div><div>------------------$B!J%5%s%W%k(B END$B!K(B----------------------------</div><div><br></div></div></div></div></div>