<%@ page language="java" pageEncoding="UTF-8"%>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://ajaxanywhere.sourceforge.net/" prefix="aa" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head> 
    <title>list.jsp</title>
 
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
<script language="javascript" src="js/aa.js"></script>
	<script>
	  <!-- 所要提交的表单 -->
		ajaxAnywhere.formName="listForm";
	 <!-- 所要刷新的区域 -->
		ajaxAnywhere.getZonesToReload = function(){
		return "formlist";
		} 
		
		function doCheck()
		{
			var f=document.forms[0];
			f.action="/TestAjaxAnyWhere/listAction.do?method=inBook";
			ajaxAnywhere.submitAJAX();
		}
	 
	</script>
  </head>
  
  <body>
    <center>
    	<div>列表</div>
     <aa:zone name="formlist">
    	<table>
    		<tr>
    			<td>ID编号&nbsp;&nbsp; </td>
    			<td>姓名</td>
    			<td>性别</td>
    			<td>工作行业</td>
    			<td>地址</td>
    		</tr>
    	 	<logic:present name="result">
    			<logic:iterate id="list" name="result">
    				  <tr>
    				  	<td><bean:write name="list" property="id" />号</td>
    				  	<td><bean:write name="list" property="name" /></td>
    				  	<td><bean:write name="list" property="sex"/></td>
    				  	<td><bean:write name="list" property="work"/></td>
    				  	<td><bean:write name="list" property="address"/></td>
    				  </tr>
    			</logic:iterate>
    		</logic:present>  
   </table>
  </aa:zone>
   </center> 
   <br>
   <br>
   <hr>
    <center>
    		<div> <h3>录入</h3></div>
    		<form name="listForm" action="/TestAjaxAnyWhere/listAction.do?method=inBook"  method="post">
    		<table>
    			
    			 <tr>
    			 	<td>姓名 :</td><td><input type="text" name="name" /></td>
    			 </tr>
    			 <tr>
    			 	<td>性别 :</td><td><input type="text" name="sex" /></td>
    			 </tr>
    			 <tr>
    			 	<td>工作行业:</td><td><input type="text" name="work" /></td>
    			 </tr>
    			 <tr>
    			 	<td>地址:</td><td><input type="text" name="address" /></td>
    			</tr>
    			<tr>
    				<td><input type="button" value="提交" onclick="doCheck()" /></td ><td><input type="reset" value="取消" /></td >
    			</tr > 
    			
    		</table>
    		</form>
    </center>
  </body>
</html>
