📄 index.jsp
字号:
<%@ taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
<s:head theme="ajax" debug="true" />
<script type="text/javascript">
dojo.event.topic.subscribe("/save", function(data, type, request) {
if (type == "load") {
dojo.byId("activityname").value = "";
dojo.byId("activitytype").value = "";
dojo.byId("activitystatus").value = "";
dojo.byId("duedate").value = "";
dojo.byId("activityclosedate").value = "";
dojo.byId("activityisclosed").value = "";
dojo.byId("activitydescription").value = "";
dojo.byId("isinvoicecreated").value = "";
dojo.byId("islock").value = "";
}
});
dojo.event.topic.subscribe("/edit", function(data, type, request) {
if (type == "before") {
var id = data.split("_")[1];
var tr = dojo.byId("row_" + id);
var tds = tr.getElementsByTagName("td");
dojo.byId("id").value = id;
dojo.byId("activityname").value = dojo.string.trim(dojo.dom.textContent(tds[0]));
dojo.byId("activitytype").value = dojo.string.trim(dojo.dom.textContent(tds[1]));
dojo.byId("activitystatus").value = dojo.string.trim(dojo.dom.textContent(tds[2]));
dojo.byId("duedate").value = dojo.string.trim(dojo.dom.textContent(tds[3]));
dojo.byId("activityclosedate").value = dojo.string.trim(dojo.dom.textContent(tds[4]));
dojo.byId("activityisclosed").value = dojo.string.trim(dojo.dom.textContent(tds[5]));
dojo.byId("activitydescription").value = dojo.string.trim(dojo.dom.textContent(tds[6]));
dojo.byId("isinvoicecreated").value = dojo.string.trim(dojo.dom.textContent(tds[7]));
dojo.byId("islock").value = dojo.string.trim(dojo.dom.textContent(tds[8]));
}
});
</script>
</head>
<body>
<div style="width: 100%; border-style: solid">
<s:form action="save" validate="true">
<s:textfield id="id" name="companyActivities.activityid" cssStyle="display:none" />
<s:textfield id="activityname" label="label.activityname" name="companyActivities.activityname" />
<s:textfield id="activitytype" label="label.activitytype" name="companyActivities.activitytype" />
<s:textfield id="activitystatus" label="label.activitystatus" name="companyActivities.activitystatus" />
<s:textfield id="duedate" label="label.duedate" name="companyActivities.duedate" />
<s:textfield id="activityclosedate" label="label.activityclosedate" name="companyActivities.activityclosedate" />
<s:textfield id="activityisclosed" label="label.activityisclosed" name="companyActivities.activityisclosed" />
<s:textfield id="activitydescription" label="label.activitydescription" name="companyActivities.activitydescription" />
<s:textfield id="isinvoicecreated" label="label.isinvoicecreated" name="companyActivities.isinvoicecreated" />
<s:textfield id="islock" label="label.islock" name="companyActivities.islock" />
<!-- Submit -->
<s:submit theme="ajax" targets="companyActivitiesList" notifyTopics="/save" />
</s:form>
</div>
<s:url action="list" id="listUrl" namespace="/admin/company/activity" />
<div style="width: 100%; border-style: solid">
<div style="text-align: right;">
<s:a theme="ajax" notifyTopics="/refresh">Refresh</s:a>
</div>
<s:div id="companyActivitiesList" theme="ajax" href="%{listUrl}" loadingText="Loading..." listenTopics="/refresh" />
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -