引用Opencms自带的树形页面

在使用move/rename功能时,点击输入框的右边的search按钮,OpenCms会弹出一个对话框让你选择move的路径,怎样在自己的页面里面调用这个弹出窗口呢?以下代码揭示了方法:

		<script type="text/javascript">
		function openTreeWin(treeType, includeFiles, formName, fieldName, curDoc) {
			var paramString = "";
			if (treeType) {
				paramString += "?type=" + treeType;
			}
			if (includeFiles) {
				paramString += ((paramString == "")?"?":"&");
				paramString += "includefiles=true";
			}
			var target = "/system/workplace/views/explorer/tree_fs.jsp" + paramString;
			if(location.pathname.indexOf("/opencms/opencms") == 0){
				target = "<%=request.getProtocol()%>://<%=request.getScheme()%>:<%=request.getProtocol()%>/opencms/opencms"+target;
			}
			treewin = openWin(target, "opencms", 300, 450);
			if (treewin.opener == null){
				treewin.opener = self;
			}
			treeForm = formName;
			treeField = fieldName;
			treeDoc = curDoc;
		}
		function openWin(url, name, w, h) {
			var newwin = window.open(url, name, 'toolbar=no,location=no,directories=no,status=yes,menubar=0,scrollbars=yes,resizable=yes,top=150,left=660,width='+w+',height='+h);
			if(newwin != null) {
				if (newwin.opener == null) {
					newwin.opener = self;
				}
			}
			newwin.focus();
			return newwin;
		}
		function setFormValue(filename) {
			document.getElementById("target").value = filename;
		}
		</script>
		</head>
		<body>
		<input type="text" id="target" name="target" value=""/><a href="javascript:openTreeWin('copy', true);" >search</a>
		...
 

 

你可能感兴趣的:(JavaScript,jsp)