<%@ page contentType="text/html; charset=Windows-31J"%>
<%@ taglib uri="/struts-html" prefix="html" %>
<%@ taglib uri="/struts-bean" prefix="bean" %>
<%@ taglib uri="/struts-logic" prefix="logic" %>
<%@ taglib uri="/terasoluna-struts" prefix="ts" %>
<%@ taglib uri="/terasoluna" prefix="t" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html:html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=shift_jis">
<title>一覧表示画面</title>
<script type="text/javascript"> 
<!--
function setDeleteSubmit(param) {
    document.forms[0].deleteId.value=param;
    document.forms[0].submit();
}
-->
</script>
</head>

<body>
<table border="0" style="width:100%;">
    <tr>
        <td align="center">
            <html:img src="image/terasoluna_logo.gif" />
        </td>
    </tr>
    <tr>
        <td align="center">
            <h2>
                一覧表示画面
            </h2>
        </td>
    </tr>
</table>

<html:messages id="message" message="true">
    <bean:write name="message"/>
</html:messages>

<ts:pageLinks id="userListPageLinks"
              action="/list" name="dynaFormBean" rowProperty="row"
              totalProperty="totalCount" indexProperty="startIndex"
              currentPageIndex="now" totalPageCount="total"/>

<ts:form action="/delete">
<center>
<h5>

<bean:write name="now"/>／<bean:write name="total"/>（<bean:write name="dynaFormBean" property="totalCount"/>）

<p>

<bean:write name="userListPageLinks" filter="false"/>

<p>
<table frame="box" border="1">
    <tr>
        <td width="30"  align="center"><b>ID</b></td>
        <td width="100" align="center"><b>NAME</b></td>
        <td width="30"  align="center"><b>AGE</b></td>
        <td width="80"  align="center"><b>BIRTH</b></td>
        <td>-</td>
    </tr>
    <logic:iterate id="userBean" name="userBeans" scope="session">
    <tr>
        <td align="center">
          <bean:write name="userBean" property="id"/>
        </td>
        <td>
          <bean:write name="userBean" property="name"/>
        </td>
        <td align="center">
          <bean:write name="userBean" property="age"/>
        </td>
        <td align="right">
          <bean:write name="userBean" property="birth"/>
        </td>
        <td>
          <bean:define id="id" name="userBean" property="id"/>
          <input type="button" value="削除" onclick="setDeleteSubmit('<%=id%>');"/>
        </td>
    </tr>
    </logic:iterate>
</table>
<p>
<input type="hidden" name="deleteId" value="" />

<bean:write name="userListPageLinks" filter="false"/>

</h5>

</center>

<hr>

<ts:link page="/insertSCR.do">登録画面</ts:link>

<ts:link page="/welcome.do">インデックス</ts:link>

</ts:form>
</body>
</html:html>