📄 fieldlist.jsp
字号:
<%@ page language="java" contentType="text/html; charset=GBK" pageEncoding="GBK"%>
<%@taglib prefix="ww" uri="webwork"%><%String contextPath = request.getContextPath();%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=GBK"><script src="<%= contextPath %>/script/util.js"></script>
<script>
var contextPath = '<%= contextPath %>';
var sAction = '<ww:property value="#parameters.action" />' ;
var sTitle = "{*[Insert]*}";
var oControl;
var oSeletion;
var sRangeType;
oSelection = dialogArguments.eWebEditor.document.selection.createRange();
sRangeType = dialogArguments.eWebEditor.document.selection.type;
if (sAction == "modify"){
if (sRangeType == "Control"){
if (oSelection.item(0).tagName.toUpperCase() == "IMG"){
oControl = oSelection.item(0);
}
}else{
oControl = getParentObject(oSelection.parentElement(), "IMG");
}
if (oControl) {
sTitle = "{*[Modify]*}";
}
}
document.write("<title>Component{*[Property]*}(" + sTitle + ")</title>");
function getInnerHTML() {
var id = '<ww:property value="#parameters.id" />';
var s = '<img type="componentfield" src="../formeditor/buttonimage/standard/component.gif" className="cn.myapps.core.dynaform.form.ejb.ComponentTag"';
s += ' componentid="' + id + '"';
s += ' aliases="' + getAliasExpr();
s += '">'
return s;
}
function ev_doConfirm() {
if(sAction == "modify"){
var s = "";
oControl.componentid = '<ww:property value="#parameters.id" />';
oControl.aliases = getAliasExpr();
}
if(dialogArguments != null) {
dialogArguments.insertHTML(getInnerHTML());
}
window.returnValue = null;
window.close();
}
function getAliasExpr() {
var rtn = "";
var elements = document.getElementsByName('fields');
for (var i=0; i < elements.length; i++) {
var name = elements[i].id;
var alias = elements[i].value;
rtn += name + ':' + alias + ';';
}
rtn = rtn.substring(0, rtn.lastIndexOf(";"));
return rtn;
}
function InitDocument(){
// {*[Get value when modifying status]*}
if (sAction == "modify"){
var aliasExpr = oControl.aliases;
//alert(aliasExpr);
var aliaslist = aliasExpr.split(";");
for(var i=0; i<aliaslist.length; i++) {
var aliasProps = aliaslist[i];
//alert(aliasProps);
var fieldName = aliasProps.substring(0, aliasProps.indexOf(":"));
var value = aliasProps.substring(aliasProps.indexOf(":") + 1);
var field = document.all(fieldName)
if (field != null && field != 'undefine') {
field.value = value;
}
}
}
}
</script>
</head><body onload="InitDocument()"><ww:form name="temp" action="list.action" method="post">
<ww:if test="hasFieldErrors()">
<span class="errorMessage"> <b>Errors:</b><br>
<ww:iterator value="fieldErrors">
*<ww:property value="value[0]" />;
</ww:iterator> </span>
</ww:if>
<table>
<tr><td colspan="2">{*[Alias Define]*}</td></tr>
<tr>
<td><input type="button" class="bt-cancel"
onclick="ev_doConfirm()" value="{*[Confirm]*}"></td>
<td><input type="button" class="bt-cancel"
onclick="doExit()" value="{*[Cancle]*}"></td>
</tr>
<ww:hidden name="id" value="%{id}" />
<ww:iterator value="fieldList">
<ww:set name="n" value="name" />
<ww:textfield id="%{n}" label="%{n}" name="fields" />
</ww:iterator> </table>
</ww:form>
</body><script>
//alert(document.all('id').value);
</script>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -