📄 index.jsp
字号:
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic"%>
<%@ taglib uri="http://ajaxanywhere.sourceforge.net/" prefix="aa"%>
<%
String path = request.getContextPath();
%>
<html>
<head>
<title>XLoadTree Demo (WebFX)</title>
<script language="javascript" src="<%=path%>/js/aa.js"></script>
<script type="text/javascript" src="<%=path%>/js/tree/xtree.js"></script>
<script type="text/javascript" src="<%=path%>/js/tree/xmlextras.js"></script>
<script type="text/javascript" src="<%=path%>/js/tree/xloadtree.js"></script>
<link type="text/css" rel="stylesheet"
href="<%=path%>/style/xtree.css" />
<link type="text/css" rel="stylesheet"
href="<%=path%>/style/styles.css" />
<script language="javascript">
ajaxAnywhere.formName = "roleForm";
function editPreview(roleId) {
//修改御览
roleForm.id.value=roleId;
roleForm.flag.value=2;
ajaxAnywhere.getZonesToReload = function(){
return "formArea";
}
ajaxAnywhere.submitAJAX();
}
function exeDelete(roleId){
//删除
roleForm.id.value=roleId;
roleForm.flag.value=4;
ajaxAnywhere.getZonesToReload = function(){
return "messageArea,dataArea";
}
ajaxAnywhere.submitAJAX();
}
function getPageData(formId){
//查询分页
ajaxAnywhere.getZonesToReload = function(){
return "dataArea";
}
roleForm.flag.value=1;
ajaxAnywhere.submitAJAX();
}
function update () {
//更新
ajaxAnywhere.getZonesToReload = function(){
return "formArea,dataArea";
}
roleForm.flag.value=3;
ajaxAnywhere.submitAJAX();
}
function doAdd() {
//增加
ajaxAnywhere.getZonesToReload = function(){
return "formArea,dataArea";
}
roleForm.flag.value=5;
ajaxAnywhere.submitAJAX();
}
</script>
</head>
<body>
<html:form action="/role.do" method="post">
<aa:zone name="formArea">
<html:hidden property="id" />
<html:hidden property="flag" />
<table align="center">
<tr>
<td>
角色名称
</td>
<td>
<html:text property="name" />
<html:errors property="name" />
</td>
</tr>
<tr>
<td>
描述
</td>
<td>
<html:text property="description" />
<html:errors property="description" />
</td>
</tr>
<tr>
<td>
所属部门
</td>
<td>
<logic:present name="departmentList">
<html:select property="departmentId">
<html:option value="">全部部门</html:option>
<html:options collection="departmentList" property="id" labelProperty="name"/>
</html:select>
<html:errors property="departmentId" />
</logic:present>
</td>
</tr>
<tr>
<td colspan="2">
<html:button property="search" value="查询" onclick="getPageData('roleForm')" />
<html:button property="edit" value="修改" onclick="update()" />
<html:button property="add" value="新增" onclick="doAdd()" />
</td>
</tr>
<logic:present name="message">
<tr>
<td colspan="2">
<bean:write name="message" />
</td>
</tr>
</logic:present>
</table>
</aa:zone>
<aa:zone name="dataArea">
<logic:present name="pageData">
<table align="center">
<tr>
<td class="th">
角色编号
</td>
<td class="th">
角色名称
</td>
<td class="th">
角色描述
</td>
<td class="th">
所属部门编号
</td>
<td class="th">
修改御览
</td>
<td class="th">
删除
</td>
</tr>
<logic:iterate id="item" name="pageData" property="dataList">
<tr>
<td>
<bean:write name="item" property="id" />
</td>
<td>
<bean:write name="item" property="name" />
</td>
<td>
<bean:write name="item" property="description" />
</td>
<td>me
<bean:write name="item" property="departmentId" />
</td>
<td>
<input type="button" value="修改御览"
onclick='editPreview("<bean:write name="item" property="id"/>")' />
</td>
<td>
<input type="button" value="删除"
onclick='exeDelete("<bean:write name="item" property="id"/>")' />
</td>
</tr>
</logic:iterate>
<tr>
<td colspan="6"><bean:write name="pageData" property="pageNav" filter="false" /></td>
</tr>
</table>
</logic:present>
</aa:zone>
</html:form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -