Hai,<br><br>Itried to add some rows to the ****Items <br>like <a href="http://ml.seasar.org/archives/seasar-user/2008-December/016543.html">http://ml.seasar.org/archives/seasar-user/2008-December/016543.html</a><br><br><br>
addrow.html<br><br><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<br><a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>"><br>
<html xmlns="<a href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</a>" xmlns:te="<br><a href="http://www.seasar.org/teeda/extension">http://www.seasar.org/teeda/extension</a>" lang="ja" xml:lang="ja"><br>
<head><br><meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /><br><script type="text/javascript" src="../../js/jquery.js"></script><br><script type="text/javascript"><br>
function addRow() {<br>var rowStr = '<tr>';<br>rowStr += '<td><span id="rowno"></span></td>';<br>rowStr += '<td><input id="userId" type="text" /></td>';<br>
rowStr += '<td><input type="hidden" id="rowno-1" /></td>';<br>rowStr += '</tr>';<br>$('#userItems').append(rowStr);<br> // $BL@:Y$N(BINDEX$B$r?6$jD>$9(B<br>resetIndex();<br>
}<br><br>// $BL@:Y$N(BINDEX$B$r?6$jD>$9(B<br>function resetIndex(){<br>var nameVal = 'includeChildBody:form:userItems:';<br>$('#userItems tr').each(function(idx, obj){<br>// $B9THV9f$r?6$jD>$9(B<br>$(obj).find('#rowno').text('' + (idx + 1));<br>
// name$BB0@-$N(Bindex$B$r?6$j$J$*$9(B<br>$(obj).find('#rowno').attr('name', nameVal + idx + ':rowno');<br>$(obj).find('#userId').attr('name', nameVal + idx + ':userId');<br>$(obj).find('#rowno-1').attr('name', nameVal + idx + ':rowno-1');<br>
});<br>}<br></script><br></head><br><body><br><span id="allMessages"/><br><form id="form"><br><table><br><thead><br><th>$B%f!<%6(BID</th><br></thead><br>
<tbody id="userItems"><br><tr><br><td><span id="rowno"></span></td><br><td><input id="userId" type="text" value="" /></td><br>
<input type="hidden" id="rowno-1"/><br></tr><br></tbody><br></table><br><input type="button" onclick="addRow()" value="ADD ROW"/><br><input type="button" id="doTest" value="TEST"/><br>
</form><br></body><br></html><br><br><br>AddrowPage.java<br><br>package testproject.web.test;<br><br>import java.sql.Timestamp;<br>import java.util.ArrayList;<br>import java.util.Date;<br>import java.util.List;<br>
import org.seasar.teeda.extension.annotation.scope.SubapplicationScope;<br>import testproject.dto.UserDto;<br><br>public class AddrowPage {<br> <br> public List<UserDto> userItems;<br> public int userIndex;<br>
public String rowno;<br> public String userId;<br>// public Class getLayout() {<br>// return null;<br>// }<br><br> public Class doTest() {<br> System.out.println("doTest size=" + userItems.size());<br>
return null;<br> }<br><br> public Class initialize() {<br> Date today = new Date();<br> userItems = new ArrayList<UserDto>();<br> UserDto user1 = new UserDto();<br> user1.timesp = new Timestamp(today.getTime());<br>
user1.rowno = "1";<br> user1.userId = "A001";<br> user1.userName = "USER A";<br> userItems.add(user1);<br> UserDto user2 = new UserDto();<br> user2.timesp = new Timestamp(today.getTime());<br>
user2.rowno = "2";<br> user2.userId = "B001";<br> user2.userName = "USER B";<br> userItems.add(user2);<br> return null;<br> }<br><br> public Class prerender() {<br>
return null;<br> }<br>}<br><br>When i click the ADDROW button i can create row in javascript,after clicking the TEST button,i checked the size of the Items,<br>Its only 2..How can i get the size including the rows created in javascrip?<br>
<br><br>Please give me some solution to solve this problem.<br><br>Thanks in advance,<br>$B%H%^%9(B<br><br><br>