📄 index.jsp
字号:
<%--
Copyright 2008 Infragistics. All Rights Reserved.
Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the following
conditions are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistribution in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
Neither the name of Infragistics or the names of
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
This software is provided "AS IS," without a warranty of any
kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
EXCLUDED. INFRAGISTICS AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY
DAMAGES OR LIABILITIES SUFFERED BY LICENSEE AS A RESULT OF OR
RELATING TO USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE OR
ITS DERIVATIVES. IN NO EVENT WILL INFRAGISTICS OR ITS LICENSORS BE LIABLE
FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT,
SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF
THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF INFRAGISTICS HAS
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
You acknowledge that this software is not designed, licensed or
intended for use in the design, construction, operation or
maintenance of any nuclear facility.
--%>
<%@ page contentType="text/html" language="java"%>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@ taglib prefix="ig" uri="http://www.infragistics.com/faces/netadvantage"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Infragistics NetAdvantage For Java Server Faces - Demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="description" content="Infragistics NetAdvantage for Java Server Faces - Demo" />
<link href="../../resources/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
function igShowDialog() {
var igJsDwNode = ig.dw.getDwJsNodeById("_form01:igDw001");
if (igJsDwNode != null) {
igJsDwNode.set_windowState(ig.dw.STATE_NORMAL);
}
}
function igClearEvents() {
var eventsDiv = document.getElementById("clientEventsList");
if (eventsDiv) {
eventsDiv.innerHTML = "";
}
}
function addLine(str) {
var eventsDiv = document.getElementById("clientEventsList");
if (eventsDiv) {
eventsDiv.innerHTML += str + "<br />";
}
}
function dwMoving(sender, args) {
var showMovingEvents = document.getElementById("cb8");
if (showMovingEvents && showMovingEvents.checked) {
addLine("Moving (x,y) old:" + args.get_oldX() + "," + args.get_oldY() + " new:" + args.get_x() + "," + args.get_y());
}
var keep_top_50_400 = document.getElementById("cb3");
if (keep_top_50_400 && keep_top_50_400.checked) {
if (args.get_y() < 50 || args.get_y() > 400) {
args.set_cancel(true);
addLine("Event canceled");
}
}
}
function dwMoved(sender, args) {
addLine("Moved (x,y) old:" + args.get_oldX() + "," + args.get_oldY() + ", new:" + args.get_x() + "," + args.get_y());
var keep_left_10_300 = document.getElementById("cb4");
if (keep_left_10_300 && keep_left_10_300.checked) {
if (args.get_x() < 10 || args.get_x() > 300) {
args.set_cancel(true);
addLine("Event canceled");
}
}
}
function dwResizing(sender, args) {
var showResizingEvents = document.getElementById("cb7");
if (showResizingEvents && showResizingEvents.checked) {
addLine("Resizing (w,h) old:" + args.get_oldWidth() + ',' + args.get_oldHeight() + " new:" + args.get_width() + "," + args.get_height());
}
var keep_width_150_400 = document.getElementById("cb5");
if (keep_width_150_400 && keep_width_150_400.checked) {
if (args.get_width() < 150 || args.get_width() > 400) {
args.set_cancel(true);
addLine("Event canceled");
}
}
}
function dwResized(sender, args) {
addLine("Resized (w,h) old:" + args.get_oldWidth() + ',' + args.get_oldHeight() + " new:" + args.get_width() + "," + args.get_height());
var keep_height_100_300 = document.getElementById("cb6");
if (keep_height_100_300 && keep_height_100_300.checked) {
if (args.get_height() < 100 || args.get_height() > 300) {
args.set_cancel(true);
addLine("Event canceled");
}
}
}
function dwStateChanging(sender, args) {
var cancelButtonEvents = document.getElementById("cb1");
if (cancelButtonEvents && cancelButtonEvents.checked) {
args.set_cancel(true);
addLine("State changing (event canceled)");
} else {
addLine("State changing");
}
}
function dwStateChanged(sender, args) {
addLine("State changed");
var postBackOnButtonEvents = document.getElementById("cb2");
if (postBackOnButtonEvents && postBackOnButtonEvents.checked) {
args.set_postBack(1);
}
}
</script>
</head>
<body class="rightPanel">
<f:view>
<h:form id="_form01">
<h:panelGroup styleClass="main">
<%-- TITLE --%>
<h:outputText styleClass="title"
value="WebDialogWindow - Client-Side Events" />
<h:panelGroup styleClass="section">
<f:verbatim escape="false">
<table align="right" width="60%"><tr><td colspan="2">
<div id="clientEventsList" style="height:200px; border:1px solid black; padding:5px; background-color:white; overflow-x:auto; overflow-y:auto"></div>
<div align="right" style="margin-top:10px; margin-bottom:20px">
<input type="button" onclick="igShowDialog();return false;" value="Show Dialog" />
<input type="button" onclick="igClearEvents();return false;" value="Clear Events" />
</div></td></tr><tr><td>
<input id="cb1" type="checkbox" />Cancel Button Events<br/>
<input id="cb2" type="checkbox" />PostBack On Button Events<br/>
<input id="cb3" type="checkbox" />Moving: keep top 50..400<br/>
<input id="cb4" type="checkbox" />Moved: keep left 10..300<br/>
</td><td>
<input id="cb5" type="checkbox" />Resizing: keep width 150..400<br/>
<input id="cb6" type="checkbox" />Resized: keep height 100..300<br/>
<input id="cb7" type="checkbox" />Show Resizing Events<br/>
<input id="cb8" type="checkbox" />Show Moving Events<br/>
</td></tr></table><br clear="all"/>
</f:verbatim>
<%-- =================================== INFRAGISTICS-CODE ==================================== --%>
<ig:dialogWindow style="left:35px;top:100px;width:310px;height:185px" initialPosition="manual" id="igDw001">
<ig:dwHeader captionText="Dialog Caption">
<ig:dwMinimizeBox />
<ig:dwMaximizeBox />
<ig:dwCloseBox />
</ig:dwHeader>
<ig:dwClientEvents
moving="dwMoving"
moved="dwMoved"
resizing="dwResizing"
resized="dwResized"
stateChanging="dwStateChanging"
stateChanged="dwStateChanged"
/>
<ig:dwContentPane>
<f:verbatim escape="false">
This is the content of the WebDialogWindow.
</f:verbatim>
</ig:dwContentPane>
<ig:dwResizer />
</ig:dialogWindow>
<%-- =================================== INFRAGISTICS-CODE ==================================== --%>
</h:panelGroup>
<h:panelGroup styleClass="section">
<%-- DESCRIPTION --%>
<ig:tabView>
<ig:tabItem value="Description">
<f:verbatim escape="false">
The WebDialogWindow offers a variety of client side events which can be handled by client code. The following example allows you to explore those events.
</f:verbatim>
</ig:tabItem>
<ig:tabItem value="JSP Source Code">
<h:outputText escape="false"
value="#{shared.jspSourceCode}" />
</ig:tabItem>
</ig:tabView>
</h:panelGroup>
</h:panelGroup>
</h:form>
</f:view>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -