$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>&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>&quot;&gt;</div>
<div>&lt;html xmlns=&quot;<a href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</a>&quot; xmlns:te=&quot;<a href="http://www.seasar.org/teeda/extension">http://www.seasar.org/teeda/extension</a>&quot; lang=&quot;ja&quot; xml:lang=&quot;ja&quot;&gt;</div>
<div>&lt;head&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html;charset=UTF-8&quot; /&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>&lt;script type=&quot;text/javascript&quot; src=&quot;jquery-1.2.6.js&quot;&gt;&lt;/script&gt;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>&lt;script type=&quot;text/javascript&quot;&gt;</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 = &#39;&lt;tr&gt;&#39;;</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>rowStr += &#39;&lt;td&gt;&lt;span id=&quot;rowno&quot;&gt;&lt;/span&gt;&lt;/td&gt;&#39;;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>rowStr += &#39;&lt;td&gt;&lt;input id=&quot;userId&quot; type=&quot;text&quot; /&gt;&lt;/td&gt;&#39;;</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>rowStr += &#39;&lt;td&gt;&lt;input type=&quot;hidden&quot; id=&quot;rowno-1&quot; /&gt;&lt;/td&gt;&#39;;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>rowStr += &#39;&lt;/tr&gt;&#39;;</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>$(&#39;#userItems&#39;).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 = &#39;form:userItems:&#39;;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>$(&#39;#userItems tr&#39;).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(&#39;#rowno&#39;).text(&#39;&#39; + (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(&#39;#rowno&#39;).attr(&#39;name&#39;, nameVal + idx + &#39;:rowno&#39;);</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                </span>$(obj).find(&#39;#userId&#39;).attr(&#39;name&#39;, nameVal + idx + &#39;:userId&#39;);</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>$(obj).find(&#39;#rowno-1&#39;).attr(&#39;name&#39;, nameVal + idx + &#39;:rowno-1&#39;);</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>&lt;/script&gt;</div>
<div>&lt;/head&gt;</div><div>&lt;body&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>&lt;span id=&quot;allMessages&quot;/&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>&lt;form id=&quot;form&quot;&gt;</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;table&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;thead&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>&lt;th&gt;$B%f!<%6(BID&lt;/th&gt;</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;/thead&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;tbody id=&quot;userItems&quot;&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>&lt;tr&gt;</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                        </span>&lt;td&gt;&lt;span id=&quot;rowno&quot;&gt;&lt;/span&gt;&lt;/td&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span>&lt;td&gt;&lt;input id=&quot;userId&quot; type=&quot;text&quot; value=&quot;&quot; /&gt;&lt;/td&gt;</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                        </span>&lt;input type=&quot;hidden&quot; id=&quot;rowno-1&quot;/&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>&lt;/tr&gt;</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;/tbody&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;/table&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;input type=&quot;button&quot; onclick=&quot;addRow()&quot; value=&quot;ADD ROW&quot;/&gt;</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;input type=&quot;button&quot; id=&quot;doTest&quot; value=&quot;TEST&quot;/&gt;<br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>&lt;/form&gt;</div>
<div>&lt;/body&gt;</div><div>&lt;/html&gt;</div><div><br></div><div><br></div><div>$B!Z%l%$%"%&%H(BHTML$B![(B</div><div><div>&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>&quot;&gt;</div>
<div>&lt;html xmlns=&quot;<a href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</a>&quot; xmlns:te=&quot;<a href="http://www.seasar.org/teeda/extension">http://www.seasar.org/teeda/extension</a>&quot; lang=&quot;ja&quot; xml:lang=&quot;ja&quot;&gt;</div>
<div>&lt;head&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>&lt;meta http-equiv=&quot;Content-type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>&lt;title&gt;$B%l%$%"%&%H(B&lt;/title&gt;</div>
<div>&lt;/head&gt;</div><div>&lt;body&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>&lt;te:includeChildBody id=&quot;includeChildBody&quot;/&gt;</div><div>&lt;/body&gt;</div><div>&lt;/html&gt;</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&lt;UserDto&gt; 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(&quot;doTest &nbsp;size=&quot; + 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&lt;UserDto&gt;();</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 = &quot;1&quot;;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>user1.userId = &quot;A001&quot;;</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>user1.userName = &quot;USER A&quot;;</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 = &quot;2&quot;;</div><div>
<span class="Apple-tab-span" style="white-space:pre">                </span>user2.userId = &quot;B001&quot;;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>user2.userName = &quot;USER B&quot;;</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>