Adobe COLDFUSION 9 Manual page 819

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Requesting and Presenting Information
<html>
<head>
<script language="javascript">
//Boolean value tacking the window state.
var shown=true;
//Functions to display an alert box when
function onshow(name) {
alert("window shown = " + name);
}
function onhide(name) {
alert("window hidden = " + name);
}
//Initialize the window show/hide behavior.
function initWindow() {
ColdFusion.Window.onShow("testWindow", onshow);
ColdFusion.Window.onHide("testWindow", onhide);
}
//Show or hide the window, depending on its current state.
function toggleWindow() {
if (shown) {
ColdFusion.Window.hide("testWindow");
shown = false;
}
else {
ColdFusion.Window.show("testWindow");
shown = true;
}
}
</script>
</head>
<!-- The body tag onLoad event calls the window show/hide initializer function. -->
<body onLoad="initWindow()">
<cfwindow name="testWindow" initshow=true title="test window" closable=true> Window contents
</cfwindow>
<cfform>
<cfinput name="button" value="Toggle Window" onclick="javascript:toggleWindow()"
type="button"/>
</cfform>
</body>
</html>
Control container contents
ColdFusion provides a variety of ways to set and change container tag contents:
• You can use bind expressions in the container tag source (or for
dynamically updates any time a bound control changes.
• You can call the
ColdFuson.navigate
specified URL. This function lets you specify a callback handler to do additional processing after the new content
loads, and also lets you specify an error handler.
cfdiv
function to change the container body to be the contents returned by a
Last updated 8/5/2010
,
) attribute. The container then
bind
814

Advertisement

Table of Contents
loading

Table of Contents