<html xmlns:m="http://www.seasar.org/maya"
        m:extends="/WEB-INF/layout/layout.html">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-31j" />
<title>ForEach</title>
</head>
<body>
<span m:inject="f:param" m:name="layoutTitle" m:value="ForEach"/>
<span m:inject="s:insert" m:name="body">
<script language="javascript">
<!--
function getOptions(){
var f = document.frm;
var cnt = f['idx'].length;
var options = new Array();
if(cnt){
for(var i = 0; i < cnt; i++){
options.push(new Option(f['frm:hoge_' + i + ':key'].value, f['frm:hoge_' + i + ':name'].value));
}
}else{
options.push(new Option(f['frm:hoge_' + i + ':key'].value, f['frm:hoge_' + i + ':name'].value));
}
alert(options);
return options;
}
//-->
</script>
<form id="frm">
<span m:inject="s:forEach" m:items="#{forEachDtoList}"
        m:var="e" m:varIndex="i" m:id="hoge">
        <input type="hidden" m:id="key" m:value="#{e.key}"/>
        <input type="hidden" m:id="name" m:value="#{e.name}"/>
        <input type="hidden" m:id="idx" m:value="#{i}" m:passthrough="true" />
</span>
<input type="button" onclick="getOptions();" value="test"/>
</form>
</span>
</body>
</html>