asp.net中点击某个按钮时打开自定义的页面(帮助文档);
(1)第一种方式:对某个文本加链接;点击后弹出某个页面;
格式参数
点击链接的;OpenWinParam为定义的js的函数;
function OpenWinParam()
{
window.open( '@d:\doc\aa.xls', '', 'left=50,top=50,resizable=1,scrollbars=1,width=500,height=400,menubar=1');
}
(1)第一种方式:对某个文本加链接;点击后弹出某个页面;
格式参数
点击链接的;OpenWinParam为定义的js的函数;
function OpenWinParam()
{
window.open( '@d:\doc\aa.xls', '', 'left=50,top=50,resizable=1,scrollbars=1,width=500,height=400,menubar=1');
}
(2)第二种方式,点击页面上某个按钮弹出html类型的页面;
其中页面上错误信息为动态获取到添加到页面上的;
var detailMsgA = [],msgIndex=0;
function setDetailMsg(index) {
var xw = wisdom.showModal(RootPath + "/msg.html", "系统信息详情");
if (detailMsgA.length == 0) {
return;
}
setTimeout(function() {
xw.get_contentFrame().contentWindow.document.body.innerHTML = detailMsgA[parseInt(index)][0].details; //.replace(//g, ">");
}, 20);
}
其中msg.html页面内容为:
下面为调用setDetailMsg方法的例子:
var hashWsdMsg = new Hashtable();
var wsdCurrentIsHaveNextCallbackCtrl = false;
wisdom.dowithmessage = function(jsonmsglist, flag) {
for (var i = 0; i < jsonmsglist.length; i++) {
if ((flag + "") == "false") {
if (jsonmsglist[i].type <= 5) return;
}
var k = jsonmsglist[i].msgKey;
if (jsonmsglist[i].context) {
k += jsonmsglist[i].context;
}
if (!hashWsdMsg.containsKey(k)) {
hashWsdMsg.add(k, jsonmsglist[i]);
}
}
var fuc = wisdom.getArgument(arguments, "function");
if (fuc != null) {
wisdom.ShowExistMsg(fuc);
}
else {
wisdom.ShowExistMsg();
}
}
wisdom.ShowExistMsg = function() {
//if (!wsdCurrentIsHaveNextCallbackCtrl) {
var str = "";
var msgArr = hashWsdMsg.values();
var msglength = msgArr.length;
//detailMsgA = msgArr;
var msgFlag = wisdom.WsdMsgFlag.reminder;
if (msglength > 0) {
if (msgArr[0][0].type == -1) {
msgFlag = wisdom.WsdMsgFlag.reminder;
} else if (msgArr[0][0].type <= 5) {
msgFlag = wisdom.WsdMsgFlag.success;
} else {
msgFlag = wisdom.WsdMsgFlag.failure;
}
}
for (var j = 0; j < msglength; j++) {
var msg = msgArr[j];
detailMsgA.push(msg);
if (wisdom.isEmpty(msg[0].context)) msg[0].context = "";
if (Array.indexOf(CurrentShowMsgKey, msg[0].msgKey + msg[0].context) != -1) {
continue;
}
CurrentShowMsgKey.push(msg[0].msgKey + msg[0].context);
var contextFlag = true;
//将{菜单编号}替换成打开菜单的连接
var menu = msg[0].context.match(/\{\w{4,15}\}/g);
if (menu != null && menu.length > 0) {
for (var m = 0; m < menu.length; m++) {
msg[0].context = msg[0].context.replace(menu[m], "解决问题请请点击!
var hashWsdMsg = new Hashtable();
var wsdCurrentIsHaveNextCallbackCtrl = false;
wisdom.dowithmessage = function(jsonmsglist, flag) {
for (var i = 0; i < jsonmsglist.length; i++) {
if ((flag + "") == "false") {
if (jsonmsglist[i].type <= 5) return;
}
var k = jsonmsglist[i].msgKey;
if (jsonmsglist[i].context) {
k += jsonmsglist[i].context;
}
if (!hashWsdMsg.containsKey(k)) {
hashWsdMsg.add(k, jsonmsglist[i]);
}
}
var fuc = wisdom.getArgument(arguments, "function");
if (fuc != null) {
wisdom.ShowExistMsg(fuc);
}
else {
wisdom.ShowExistMsg();
}
}
wisdom.ShowExistMsg = function() {
//if (!wsdCurrentIsHaveNextCallbackCtrl) {
var str = "";
var msgArr = hashWsdMsg.values();
var msglength = msgArr.length;
//detailMsgA = msgArr;
var msgFlag = wisdom.WsdMsgFlag.reminder;
if (msglength > 0) {
if (msgArr[0][0].type == -1) {
msgFlag = wisdom.WsdMsgFlag.reminder;
} else if (msgArr[0][0].type <= 5) {
msgFlag = wisdom.WsdMsgFlag.success;
} else {
msgFlag = wisdom.WsdMsgFlag.failure;
}
}
for (var j = 0; j < msglength; j++) {
var msg = msgArr[j];
detailMsgA.push(msg);
if (wisdom.isEmpty(msg[0].context)) msg[0].context = "";
if (Array.indexOf(CurrentShowMsgKey, msg[0].msgKey + msg[0].context) != -1) {
continue;
}
CurrentShowMsgKey.push(msg[0].msgKey + msg[0].context);
var contextFlag = true;
//将{菜单编号}替换成打开菜单的连接
var menu = msg[0].context.match(/\{\w{4,15}\}/g);
if (menu != null && menu.length > 0) {
for (var m = 0; m < menu.length; m++) {
msg[0].context = msg[0].context.replace(menu[m], "解决问题请请点击!
");
}
contextFlag = false;
}
//---
//str = str + msg[0].id + ":" + msg[0].context + "(" + msg[0].owner + ")";
msg[0].context = msg[0].context.replace(/\{(\d{1,2})\}/g, ""); //{0}对应owner
str = str + msg[0].context; //.replace(/\[([^\]]+)?\]/g, ""); //[..]后端对应占位符
if (contextFlag && !wisdom.isEmpty(msg[0].msgKey)) {
str = "{" + msg[0].msgKey + "}" + str;
}
if (msg[0].details && msg[0].details.trim() != "") {
str += " [详情]";
}
str = str + "
";
}
if (!wisdom.isEmpty(str.toLowerCase().replace(/
/g, ""))) {
var fuc = function() {
detailMsgA = [];
};
var fucMsgClose = wisdom.getArgument(arguments, "function");
if (fucMsgClose != null) {
fuc = function() { detailMsgA = []; fucMsgClose(); };
}
wisdom.alert(str, fuc, msgFlag);
hashWsdMsg.clear();
}
//}
}
}
contextFlag = false;
}
//---
//str = str + msg[0].id + ":" + msg[0].context + "(" + msg[0].owner + ")";
msg[0].context = msg[0].context.replace(/\{(\d{1,2})\}/g, ""); //{0}对应owner
str = str + msg[0].context; //.replace(/\[([^\]]+)?\]/g, ""); //[..]后端对应占位符
if (contextFlag && !wisdom.isEmpty(msg[0].msgKey)) {
str = "{" + msg[0].msgKey + "}" + str;
}
if (msg[0].details && msg[0].details.trim() != "") {
str += " [详情]";
}
str = str + "
";
}
if (!wisdom.isEmpty(str.toLowerCase().replace(/
/g, ""))) {
var fuc = function() {
detailMsgA = [];
};
var fucMsgClose = wisdom.getArgument(arguments, "function");
if (fucMsgClose != null) {
fuc = function() { detailMsgA = []; fucMsgClose(); };
}
wisdom.alert(str, fuc, msgFlag);
hashWsdMsg.clear();
}
//}
}