How to get output in a file or browser using cfdump in coldfusion

cfdump - get output in a file or browser

cfdumpOutput.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cfdump tag: how to get output in a file or browser</title>
</head>

<body>
<h2 style="color:OrangeRed; font-style:italic">cfdump tag example: how to get output in a file or browser</h2>
<hr width="575" align="left" color="CadetBlue" />
<br />

<cfquery name="qCenters" datasource="cfdocexamples" maxrows="3">
 Select Center_ID, Name From Centers
</cfquery>

<cfdump var="#qCenters#" label="Centers [file output]" output="c:\Centers.txt">
<br /><br />

<cfdump var="#qCenters#" label="Centers [browser output]" output="browser">

</body>
</html>









More ColdFusion tutorials

How to use cfdump format (html, text) in ColdFusion

Introduction

In Adobe ColdFusion, the <cfdump> tag is a handy tool that developers often use to debug their code by displaying the contents of variables. This tag can present data in different formats, making it easier to visualize and understand complex structures like arrays, queries, and objects. One of the key attributes of the <cfdump> tag is the format attribute, which allows developers to choose between HTML and plain text output for displaying the variable data.

This tutorial demonstrates how to use the format attribute in the <cfdump> tag with a simple example involving a ColdFusion structure. The example shows how to switch between HTML and text formats for dumping variable content, which can be particularly useful in different development environments or when rendering output in specific formats for different devices.

Understanding the Structure

In the provided example, a structure called Color is created using ColdFusion's StructNew() function. This structure represents a color object with three properties: ID, Name, and Value. The ID is a numerical identifier, the Name holds a string representing the color name (in this case, "Bisque"), and the Value contains the hexadecimal code for the color.

Once the structure is created and populated with data, the <cfdump> tag is used to display its contents in two different formats: HTML and plain text. This demonstrates how the format attribute can be utilized to output the same data in two distinct ways, depending on the development or debugging needs.

Using the HTML Format

The first <cfdump> tag in the example uses the format="html" attribute to display the Color structure in an HTML-friendly format. This is the default behavior of the <cfdump> tag if no format is specified, but explicitly setting format="html" ensures the output is structured for the web. In this format, the output appears as a well-organized table, making it easy to read and navigate, especially when debugging in a browser.

HTML output is typically used in web-based applications because it leverages the browser's ability to render the data in a visually appealing and interactive format. This format is particularly useful for reviewing the structure and content of complex data types like arrays, structures, and queries.

Using the Text Format

The second <cfdump> tag in the example switches the format attribute to "text". When format="text" is used, the output is rendered in plain text, which is useful in environments where HTML is not suitable, such as log files, terminal windows, or non-visual interfaces. The plain text format strips away the HTML tags and styles, showing only the raw data, which can be beneficial for quick and simple debugging without the need for a browser.

Text output is often preferable when developers need to review the raw content of a variable without any visual aids, or when the output needs to be processed further by text-based tools or scripts.

Conclusion

This tutorial demonstrated the use of the format attribute in the ColdFusion <cfdump> tag, illustrating how you can control the way data is displayed—either in HTML or plain text format. The ability to switch between these formats adds flexibility to the debugging process, allowing developers to choose the most appropriate format based on their current environment or requirements.

Whether you're working in a browser or a text-based environment, the <cfdump> tag provides a powerful and simple way to inspect ColdFusion variables and structures. Understanding how to use the format attribute effectively can make your debugging process smoother and more adaptable to various scenarios.


cfdumpFormat.cfm

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cfdump tag: how to use format (html, text) attribute in cfdump in coldfusion</title>
</head>

<body>
<h2 style="color:DodgerBlue; font-style:italic">cfdump tag example: how to use format (html, text) attribute</h2>
<hr width="600" align="left" color="CadetBlue" />
<br />

<cfset Color=StructNew()>
<cfset Color.ID=1>
<cfset Color.Name="Bisque">
<cfset Color.Value="##FFE4C4">

<cfdump var="#Color#" label="Color [Format html]" format="html">
<br /><br />

<cfdump var="#Color#" label="Color [format text]" format="text">

</body>
</html>






More ColdFusion examples

How to display bookmark in a PDF document in ColdFusion

CFdocument - Show bookmark in PDF document

cfdocumentBookmark.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cfdocument tag: how to use and show bookmark in pdf document in coldfusion</title>
</head>

<body>

<cfquery name="qCenters" datasource="cfdocexamples" maxrows="11">
 SELECT Center_ID, Name, City FROM CENTERS
</cfquery>

<cfquery name="qParks" datasource="cfdocexamples" maxrows="11">
 SELECT ParkName, City FROM Parks
</cfquery>

<cfdocument format="pdf" bookmark="true">
 <cfoutput>
        <cfdocumentitem type="header">
            Current Page Number: #cfdocument.currentpagenumber#
        </cfdocumentitem>

        <cfdocumentsection name="Center Details">
            <h4 style="color:DarkCyan; font-style:italic">
                Center Details
            </h4>
            <cftable query="qCenters" colheaders="yes" htmltable="no" border="no">
                <cfcol header="Center ID" text="#Center_ID#">
                <cfcol header="Center Name" text="#Name#">
                <cfcol header="City" text="#City#">
            </cftable>
        </cfdocumentsection>

        <cfdocumentsection name="Park Details">
            <h4 style="color:DarkCyan; font-style:italic">
                Park Details
            </h4>
            <cftable query="qParks" colheaders="yes" htmltable="no" border="no">
                <cfcol header="Park Name" text="#ParkName#">
                <cfcol header="City" text="#City#">
            </cftable>
        </cfdocumentsection>
 </cfoutput>
</cfdocument>

</body>
</html>









More ColdFusion examples

How to show footer in a printable PDF document in ColdFusion

CFdocument - Show footer in printable document

cfdocumentFooter.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cfdocument tag: how to show footer in printable document as cfdocumentitem type footer</title>
</head>

<body>

<cfquery name="qCenters" datasource="cfdocexamples" maxrows="11">
 SELECT Center_ID, Name, City FROM CENTERS
</cfquery>

<cfdocument format="pdf">
 <cfoutput>
        <cfdocumentitem type="footer">
            Page Footer <br />Current Page Number: #cfdocument.currentpagenumber#
        </cfdocumentitem>

        <cfdocumentsection>
            <h4 style="color:DarkCyan; font-style:italic">
                cfdocument example: display document footer
            </h4>
            <cftable query="qCenters" colheaders="yes" htmltable="no" border="no">
                <cfcol header="Center ID" text="#Center_ID#">
                <cfcol header="Center Name" text="#Name#">
                <cfcol header="City" text="#City#">
            </cftable>
            <cfdocumentitem type="pagebreak">
            </cfdocumentitem>
            <h3 style="color:DimGray; font-style:italic">
                This is a new page
            </h3>
        </cfdocumentsection>
 </cfoutput>
</cfdocument>

</body>
</html>









More ColdFusion examples

How to display web pages in a printable PDF document in ColdFusion

cfdocument and cfhttp - display web pages in printable document

cfdocumentDispalyWebPages.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cfdocument and cfhttp tag: how to display web pages in printable document</title>
</head>

<body>
<cfhttp url="http://www.gmail.com/" resolveurl="yes">

<cfdocument format="pdf">
 <cfoutput>
     #cfhttp.FileContent#
    </cfoutput>
</cfdocument>

</body>
</html>






More ColdFusion examples

How to create a PDF document in ColdFusion

cfdocument - create printable pdf format document

cfdocumentPDF.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cfdocument tag: how to create printable pdf format document in coldfusion</title>
</head>

<body>

<cfquery name="qCourses" datasource="cfdocexamples" maxrows="10">
 SELECT Course_ID, Number, Descript from COURSES
</cfquery>

<cfdocument format="pdf">
    <h3 style="color:OrangeRed; font-style:italic">
        cfdocument example: Printable pdf document
    </h3>
 <cftable query="qCourses" colheaders="yes" htmltable="no" border="no">
     <cfcol header="Course ID" text="#Course_ID#" align="left">
     <cfcol header="Number" text="#Number#" align="left">
     <cfcol header="Description" text="#Descript#">
    </cftable>
</cfdocument>

</body>
</html>






More ColdFusion examples

How to add page break in a PDF document in ColdFusion

Introduction

In web development, generating dynamic PDF documents can be a common requirement, especially for creating reports, invoices, or printable pages directly from a web application. Adobe ColdFusion provides a powerful way to generate PDFs with the <cfdocument> tag, which makes it easy to convert HTML content into a PDF format. One of the key features often required in PDF creation is the ability to control page breaks, ensuring that content is properly structured and separated into different pages. This tutorial demonstrates how to implement page breaks using ColdFusion’s <cfdocumentitem> tag within a PDF document.

In this example, we retrieve data from a database and display it in a PDF document with a page break separating different sections of the content. Understanding how to use the <cfdocumentitem> tag for page breaks is crucial for developers looking to control the layout of their ColdFusion-generated PDF documents.

Database Query and Data Retrieval

The first step in the example involves retrieving data from a database using ColdFusion’s <cfquery> tag. In this case, we query a database table that contains information about parks, specifically their names and associated cities. The result of the query is stored in the qParks variable, which will be used later to display the data in the PDF document.

This step is typical in dynamic PDF generation, where you often pull data from a database to present in a structured format like a table. By limiting the number of rows to 10 (maxrows="10"), we ensure that the PDF only contains a manageable amount of data for demonstration purposes.

PDF Generation Using <cfdocument>

The core of this tutorial revolves around the <cfdocument> tag, which handles the generation of the PDF. The format is set to "pdf", instructing ColdFusion to generate the output as a PDF file. Everything inside the <cfdocument> tag will be included in the PDF, making it an essential container for all the content you want to appear in the document.

The use of the <cfoutput> tag allows dynamic ColdFusion expressions and variables to be processed within the PDF content. This combination is commonly used to output both static text and dynamic data, as well as to implement advanced PDF features such as headers, footers, and page breaks.

Adding Headers and Footers

The <cfdocumentitem> tag is used within the PDF to define special sections, such as headers and footers. In this example, the header contains the text “This is Page Header” and dynamically includes the total page count using the #cfdocument.totalpagecount# variable. This feature is particularly useful when creating multi-page documents where you want to include page numbers or additional information consistently at the top or bottom of each page.

Headers are defined using type="header" within the <cfdocumentitem> tag, making them appear at the top of each page. This is a handy way to ensure that information like page numbers or document titles appear uniformly across all pages.

Displaying Data in a Table

The main content of the PDF includes a table that lists park names and their respective cities. The <cftable> tag is used here to create a simple table, with the columns dynamically populated from the qParks query. This is a powerful feature of ColdFusion, allowing you to directly bind query results to a table and easily generate PDF tables from database queries.

Each column in the table is defined using the <cfcol> tag, where header defines the column header, and text specifies the dynamic data to display. In this example, the ParkName and City fields from the query are inserted into the table columns.

Implementing Page Breaks

The key feature of this tutorial is the use of the <cfdocumentitem> tag to add a page break. By specifying type="pagebreak", you instruct ColdFusion to insert a page break at that point in the PDF document. This ensures that all content before the page break is placed on one page, and any content after the page break starts on a new page.

In the example, a table of parks is displayed on the first page, and after the page break, a new section is introduced with the heading “This is another page.” This demonstrates how you can easily control where content should be split across multiple pages in a PDF document, which is useful for creating structured and organized reports.

Styling and Layout

The example includes basic inline styling for the headings, with color and font-style applied to make the PDF visually appealing. ColdFusion allows you to use HTML and CSS within the <cfdocument> tag to style your PDF content just as you would for a regular web page. This flexibility enables developers to create visually rich PDF documents while maintaining control over the layout and formatting.

In this case, the heading “cfdocument example: using page break” is styled with a crimson color and italic font, while the second page’s heading “This is another page” uses a dim gray color. These styles help distinguish different sections of the document visually.

Conclusion

Generating PDF documents in ColdFusion is a straightforward and efficient process thanks to the <cfdocument> and <cfdocumentitem> tags. This tutorial demonstrated how to add page breaks, headers, and structured tables to a PDF, all while retrieving dynamic data from a database. By utilizing the type="pagebreak" functionality, developers can ensure that content is neatly separated across multiple pages in a professional-looking document.

Understanding these techniques allows ColdFusion developers to create well-organized, multi-page PDFs suitable for a variety of use cases, from business reports to invoices. With the flexibility of ColdFusion’s PDF generation capabilities, developers can easily meet the demands of modern web applications that require printable and shareable documents.


cfdocumentPagebreak.cfm

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cfdocument tag: how to use pagebreak (page break) as cfdocumentitem type in printable document</title>
</head>

<body>

<cfquery name="qParks" datasource="cfdocexamples" maxrows="10">
 SELECT ParkName, City FROM PARKS
</cfquery>

<cfdocument format="pdf">
 <cfoutput>
        <cfdocumentitem type="header">
            This isPage Header <br />
            Total Page Count: #cfdocument.totalpagecount#
        </cfdocumentitem>

        <cfdocumentsection>
            <h3 style="color:Crimson; font-style:italic">
                cfdocument example: using page break
            </h3>
            <cftable query="qParks" colheaders="yes" htmltable="no" border="no">
                <cfcol header="Park Name" text="#ParkName#">
                <cfcol header="City" text="#City#">
            </cftable>
            <cfdocumentitem type="pagebreak">
            </cfdocumentitem>
            <h3 style="color:DimGray; font-style:italic">
                This is another page
            </h3>
        </cfdocumentsection>
 </cfoutput>
</cfdocument>

</body>
</html>









More ColdFusion examples

How to change Chart series color in ColdFusion

cfchart - chart series color

cfchartSeriescolor.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cfchart tag: how to set change chart series color (seriescolor)</title>
</head>

<body>
<h2 style="color:PaleVioletRed; font-style:italic">cfchart example: how to change chart series color</h2>
<hr width="675" align="left" color="PaleVioletRed" />
<br />

<cfchart 
    format="jpg"
    xaxistitle="Employee"
    chartheight="375"
    yaxistitle="Monthly Salary"
    databackgroundcolor="FF4500"
    chartwidth="675"
    fontbold="yes"
    fontsize="13"
    backgroundcolor="BC8F8F"
    foregroundcolor="FFF5EE"
    showxgridlines="yes"
    gridlines="5"
    show3d="yes"
    font="Comic Sans MS"
    sortxaxis="no"
    showborder="no"
    showygridlines="yes"
    >
    <cfchartseries 
        type="bar" 
        seriescolor="D87093"
        >
        <cfchartdata item="Rabi" value="1250">
        <cfchartdata item="Jonaki" value="780">
        <cfchartdata item="Sonali" value="1800">
        <cfchartdata item="Buri" value="1695">
        <cfchartdata item="Pocha" value="1125">
    </cfchartseries>
</cfchart>
</body>
</html>





More ColdFusion examples

How to create a Chart in ColdFusion

Introduction

ColdFusion, an Adobe-owned scripting language, offers a wide range of powerful features, including the ability to create dynamic charts and graphs. This tutorial focuses on one such feature—the <cfchart> and <cfchartseries> tags—which allow developers to easily generate graphical representations of data retrieved from a database. Understanding how to use these tags can help enhance the visual presentation of data in web applications, making complex information easier to interpret.

This article explains how to use ColdFusion to create a bar chart that displays employee salaries. The chart pulls data from a database query and renders it as a dynamic image, which is displayed directly on a web page. In the following sections, we’ll break down each part of the code and explain its role in generating the chart.

Setting Up the Data Query

Before creating the chart, the data needs to be pulled from a data source. The <cfquery> tag is used here to retrieve employee data from the database. Specifically, it selects the FirstName and Salary fields from an EMPLOYEE table. The data source for this query is defined as cfdocexamples, and the number of results is limited to eight rows to keep the chart concise and easy to read. The result of this query is stored in a query object named qEmployee, which will later be used to populate the chart.

Creating the Chart with <cfchart>

The <cfchart> tag is responsible for generating the chart. In this example, the chart is set to be in a "jpg" format, meaning it will render as an image. Key attributes such as xaxistitle and yaxistitle are used to label the X and Y axes, with the first names of the employees displayed along the X-axis and the salaries shown along the Y-axis. The chartheight and chartwidth attributes control the dimensions of the chart, while the backgroundcolor and foregroundcolor settings adjust its color scheme. Notably, the show3d attribute is set to "yes," which adds a three-dimensional effect to the chart, making it more visually engaging.

Defining the Data Series with <cfchartseries>

The <cfchartseries> tag is where the actual data from the qEmployee query is linked to the chart. This tag specifies the type of chart series—in this case, a "bar" chart. The itemcolumn attribute is set to the FirstName field, which determines the labels that appear along the X-axis, while the valuecolumn is set to the Salary field, determining the height of each bar. The seriescolor attribute is used to set the color of the bars to a shade of green, giving the chart a distinct and professional look.

Visual Customization

ColdFusion allows developers to customize the visual appearance of charts extensively. In this example, several attributes have been defined to adjust the aesthetic properties of the chart. The background color is set to a dark gray (2F4F4F), while the foreground (including text and axis labels) is rendered in white (FFFFFF). The series bars are colored in a muted green (556B2F), which contrasts well against the darker background, making the data easy to read. Additionally, the use of the show3d="yes" attribute adds depth to the chart, making it more visually appealing.

Conclusion

Using ColdFusion’s <cfchart> and <cfchartseries> tags provides a straightforward way to incorporate dynamic charts into web applications. By leveraging database queries, you can easily populate charts with live data, ensuring that the visualizations are always up to date. This particular example illustrates how to create a simple bar chart that displays employee salaries, but ColdFusion supports many other chart types (e.g., pie charts, line charts) and customization options, offering flexibility for various data visualization needs.

Mastering these charting features allows developers to create more interactive and user-friendly applications, improving how information is communicated to end-users.


cfchartseries.cfm

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cfchartseries tag: how to use cfchartseries with cfchart in coldfusion</title>
</head>

<body>
<h2 style="color:DimGray; font-style:italic">cfchartseries example: how to use</h2>
<hr width="700" align="left" color="LightPink" />
<br />

<cfquery name="qEmployee" datasource="cfdocexamples" maxrows="8">
 SELECT FirstName, LastName, Salary FROM EMPLOYEE
</cfquery>

<cfchart 
    format="jpg"
    xaxistitle="First Name"
    yaxistitle="Salary"
    chartheight="400"
    chartwidth="700"
    backgroundcolor="2F4F4F"
    foregroundcolor="FFFFFF"
    show3d="yes"
    >
    <cfchartseries 
     query="qEmployee" 
        type="bar" 
        itemcolumn="FirstName" 
        valuecolumn="Salary"
        seriescolor="556B2F"
        >
    </cfchartseries>
</cfchart>
</body>
</html>





More ColdFusion examples

Pie Chart pie slice style in ColdFusion

cfchart - pieslicestyle property in pie chart

cfchartpieSliceStyle.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cfchart tag: how to use pieslicestyle property in pie chart in coldfusion</title>
</head>

<body>
<h2 style="color:DarkSeaGreen; font-style:italic">cfchart example: how to use pieslicestyle property in pie chart</h2>
<hr width="700" align="left" color="DarkSeaGreen" />
<br />

<cfquery name="qEmployee" datasource="cfdocexamples" maxrows="4">
 SELECT FirstName, LastName, Salary FROM EMPLOYEE
</cfquery>

<cfchart 
    format="png"
    xaxistitle="First Name"
    yaxistitle="Salary"
    chartheight="400"
    chartwidth="700"
    showlegend="no"
    backgroundcolor="696969"
    fontbold="yes"
    foregroundcolor="FFFAFA"
    show3d="yes"
    databackgroundcolor="DA70D6"
    font="Verdana"
    fontsize="13"
    showxgridlines="no"
    showygridlines="yes"
    sortxaxis="no"
    showborder="no"
    pieslicestyle="sliced"
    >
    <cfchartseries 
     query="qEmployee" 
        type="pie" 
        itemcolumn="FirstName" 
        valuecolumn="Salary"
        colorlist="FFE4E1,FFEFD5,D2B48C,FFFAFA,F5DEB3" 
        >
    </cfchartseries>
</cfchart>
</body>
</html>





More ColdFusion examples

How to set Pie chart color list in ColdFusion

cfchart - colorlist in pie chart

cfchartPie.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cfchart tag: how to use colorlist in pie chart in coldfusion</title>
</head>

<body>
<h2 style="color:DarkOliveGreen; font-style:italic">cfchart example: how to use colorlist in pie chart</h2>
<hr width="700" align="left" color="LightPink" />
<br />

<cfquery name="qEmployee" datasource="cfdocexamples" maxrows="5">
 SELECT FirstName, LastName, Salary FROM EMPLOYEE
</cfquery>

<cfchart 
    format="png"
    xaxistitle="First Name"
    yaxistitle="Salary"
    chartheight="400"
    chartwidth="700"
    showlegend="yes"
    fontbold="yes"
    backgroundcolor="BC8F8F"
    foregroundcolor="FFFAFA"
    show3d="yes"
    databackgroundcolor="8FBC8F"
    font="Verdana"
    fontsize="13"
    showxgridlines="no"
    showygridlines="yes"
    >
    <cfchartseries 
     query="qEmployee" 
        type="pie" 
        colorlist="FFE4E1,FFEFD5,D2B48C,FFDAB9,F5DEB3" 
        itemcolumn="FirstName" 
        valuecolumn="Salary"
        >
    </cfchartseries>
</cfchart>
</body>
</html>





More ColdFusion examples

CFchart - Chart series paint style in ColdFusion

cfchart - paintstyle property in cfchartseries

cfchartpaintstyle.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cfchart tag: how to use paintstyle property in cfchartseries in coldfusion</title>
</head>

<body>
<h2 style="color:Tan; font-style:italic">cfchart example: how to use paintstyle property in cfchartseries</h2>
<hr width="700" align="left" color="Tan" />
<br />

<cfquery name="qEmployee" datasource="cfdocexamples" maxrows="4">
 SELECT FirstName, LastName, Salary FROM EMPLOYEE
</cfquery>

<cfchart 
    format="png"
    xaxistitle="First Name"
    yaxistitle="Salary"
    chartheight="400"
    chartwidth="700"
    showlegend="no"
    backgroundcolor="D2B48C"
    foregroundcolor="FFFAFA"
    fontbold="yes"
    show3d="yes"
    showxgridlines="no"
    databackgroundcolor="FFA500"
    font="Verdana"
    fontsize="13"
    showygridlines="yes"
    sortxaxis="no"
    showborder="no"
    >
    <cfchartseries 
     query="qEmployee" 
        type="area" 
        itemcolumn="FirstName" 
        valuecolumn="Salary"
        seriescolor="FF4500"
        paintstyle="shade"
        >
    </cfchartseries>
</cfchart>
</body>
</html>





More ColdFusion examples

How to display legend on a Chart in ColdFusion

cfchart - legend in chart

cfchartLegend.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cfchart tag: how to use legend in chart in coldfusion</title>
</head>

<body>
<h2 style="color:DarkOliveGreen; font-style:italic">cfchart example: how to use legend</h2>
<hr width="700" align="left" color="LightPink" />
<br />

<cfquery name="qEmployee" datasource="cfdocexamples" maxrows="10">
 SELECT FirstName, LastName, Salary FROM EMPLOYEE
</cfquery>

<cfchart 
    format="png"
    xaxistitle="First Name"
    yaxistitle="Salary"
    chartheight="400"
    chartwidth="700"
    showlegend="yes"
    backgroundcolor="2F4F4F"
    foregroundcolor="FFFAFA"
    fontbold="yes"
    show3d="yes"
    databackgroundcolor="8FBC8F"
    font="Verdana"
    fontsize="13"
    showxgridlines="no"
    showygridlines="yes"
    >
    <cfchartseries 
     query="qEmployee" 
        type="pie" 
        itemcolumn="FirstName" 
        valuecolumn="Salary"
        >
    </cfchartseries>
</cfchart>
</body>
</html>





More coldfusion examples

Chart label format (currency, date, number, percent) in ColdFusion

cfchart - label format (currency, date, number, percent) in chart

cfchartLabelFormat.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cfchart tag: how to use label format (currency, date, number, percent) in chart</title>
</head>

<body>
<h2 style="color:RosyBrown; font-style:italic">cfchart example: how to use label format in chart</h2>
<hr width="700" align="left" color="RosyBrown" />
<br />

<cfchart 
    format="png"
    xaxistitle="First Name"
    yaxistitle="Salary"
    chartheight="400"
    chartwidth="700"
    foregroundcolor="FFFAFA"
    backgroundcolor="BC8F8F"
    fontbold="yes"
    show3d="yes"
    databackgroundcolor="DDA0DD"
    font="Verdana"
    fontsize="13"
    showxgridlines="no"
    showygridlines="yes"
    labelformat="currency"
    >
    <cfchartseries 
        type="bar" 
        seriescolor="8B4513"
     paintstyle="light"        
        >
        <cfchartdata item="Farhana" value="1295">
        <cfchartdata item="Faria" value="2900">
        <cfchartdata item="Kak" value="1840">
        <cfchartdata item="Moyna" value="1650">
        <cfchartdata item="Monalisa" value="1110">
    </cfchartseries>
</cfchart>
</body>
</html>





More coldfusion examples

How to create a 3D Chart in ColdFusion

cfchart - 3d chart

cfchart3D.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cfchart tag: how to use 3d chart in coldfusion</title>
</head>

<body>
<h2 style="color:Crimson; font-style:italic">cfchart example:  how to use 3d chart</h2>
<hr width="700" align="left" color="LightPink" />
<br />

<cfquery name="qEmployee" datasource="cfdocexamples" maxrows="10">
 SELECT FirstName, LastName, Salary FROM EMPLOYEE
</cfquery>

<cfchart 
    format="png"
    xaxistitle="First Name"
    chartheight="400"
    chartwidth="700"
    yaxistitle="Salary"
    showlegend="no"
    backgroundcolor="E9967A"
    labelformat="currency"
    foregroundcolor="FFFAFA"
    fontbold="yes"
    show3d="yes"
    databackgroundcolor="FF4500"
    font="Verdana"
    fontsize="13"
    showxgridlines="no"
    showygridlines="yes"
    >
    <cfchartseries 
     query="qEmployee" 
        type="curve" 
        itemcolumn="FirstName" 
        valuecolumn="Salary"
        >
    </cfchartseries>
</cfchart>
</body>
</html>





More ColdFusion examples

How to use splitter in a border type layout in ColdFusion

Introduction

In ColdFusion, the <cflayout> tag provides a way to create dynamic, interactive, and responsive layouts for web applications. One useful feature in this context is the splitter, which allows users to resize different layout sections, improving usability and giving more control over how information is displayed on the screen. This tutorial explains how to implement a border-type layout in ColdFusion with splitters in each area using the <cflayout> and <cflayoutarea> tags. We'll examine how each section of the code contributes to building a flexible, resizable interface suitable for many types of applications.

The example code provided shows how to create a border-type layout with resizable panels on each side. By the end of this breakdown, you’ll understand how to apply this layout and enhance user interactions by enabling splitters in different areas of the interface.

Setting Up the Border Layout

The <cflayout> tag is used here to create the main structure of the layout, with the type="border" attribute indicating that it will follow a border layout model. The border layout divides the interface into five possible sections: top, left, center, right, and bottom. These sections act as containers for content and can be arranged to suit different interface requirements.

In this example, the <cflayout> tag specifies a fixed height and width (height="400px" and width="650px") to contain the layout within a defined space. Additional styling options, such as text-align:center, help in positioning content within each area. This initial setup defines the overall structure within which each section or "pane" will fit.

Creating Resizable Layout Areas with Splitters

The layout areas are defined using <cflayoutarea> tags. Each area has a name, a position, and an optional splitter attribute. In this example, there are five areas: top, left, center, right, and bottom, which correspond to the five sections of a border layout.

The splitter="true" attribute is applied to the top, left, right, and bottom areas, allowing users to resize these sections. This feature provides flexibility in adjusting the space allocated to each section. For example, the left panel could be used to hold navigation elements, and by enabling the splitter, users can adjust its width to make it more or less prominent as needed.

Center Layout Area

The center section, created by the <cflayoutarea> tag with position="center", typically serves as the main content area in a border layout. In this example, the center area displays an image, adding a visual component to the layout. This center area does not have the splitter attribute enabled, meaning it will remain a static size within the layout. This setup is typical in border layouts, where the central section is usually the focal point and often remains unchanged in size.

Adding Visual Customization and Content

Beyond structural tags, a few stylistic details are used to enhance the look and feel of this layout. The layout includes a title in green with italic styling to indicate the example’s purpose. There is also a horizontal line colored light pink, which provides a visual separator between the title and the layout itself. These minor styling choices help frame the layout, giving it a clean, organized appearance.

The image in the center panel (<img src="Images/Dolphin2.JPG" />) brings visual interest to the layout. This section can easily be modified to include any other form of content, such as text, tables, or media, depending on the application’s needs.

Conclusion

This example demonstrates how to use ColdFusion’s <cflayout> and <cflayoutarea> tags to create a border layout with splitters. By enabling splitters on the top, left, right, and bottom sections, this layout becomes resizable and user-friendly, allowing a customized viewing experience. The layout can be adapted for various applications, especially for dashboards or admin panels, where users benefit from being able to adjust the view dynamically.

Incorporating splitters in a border layout can make the interface both functional and flexible. This approach gives end-users the ability to personalize their view, enhancing overall usability and interaction within ColdFusion applications.


cflayoutSplitter.cfm

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cflayout tag: how to use splitter in a border type layout in coldfusion</title>
</head>

<body>
<h2 style="color:SeaGreen; font-style:italic">cflayout example: using splitter in border type layout</h2>
<hr width="550" align="left" color="LightPink" />
<br />

<cflayout name="BorderLayout" type="border" style="height:400px; width:650px; text-align:center">
 <cflayoutarea name="TopBar" position="top" splitter="true">
     Top
    </cflayoutarea>
 <cflayoutarea name="LeftBar" position="left" splitter="true">
     Left
    </cflayoutarea>
 <cflayoutarea name="CenterBar" position="center">
     <img src="Images/Dolphin2.JPG" />
    </cflayoutarea>
 <cflayoutarea name="RightBar" position="right" splitter="true">
     Right
    </cflayoutarea>
 <cflayoutarea name="BottomBar" position="bottom"  splitter="true">
     Bottom
    </cflayoutarea>
</cflayout>

</body>
</html>



More ColdFusion examples

How to create collapsible layout area in a border layout in ColdFusion

cflayout - collapsible layout area in a border layout

cflayoutCollapsible.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cflayout tag: how to create collapsible layout area in a border type layout</title>
</head>

<body>
<h2 style="color:SaddleBrown; font-style:italic">cflayout example: collapsible layoutarea</h2>
<hr width="550" align="left" color="LightPink" />
<br />

<cflayout name="BorderLayout" type="border" style="height:450px; width:575px; text-align:center">
 <cflayoutarea name="TopBar" position="top">
     Top
    </cflayoutarea>
 <cflayoutarea name="LeftBar" position="left" closable="true" style="width:75px" collapsible="true">
     Left
    </cflayoutarea>
 <cflayoutarea name="CenterBar" position="center">
     <img src="Images/Dolphin1.JPG" />
    </cflayoutarea>
 <cflayoutarea name="RightBar" position="right" closable="true" collapsible="true" style="width:75px">
     Right
    </cflayoutarea>
 <cflayoutarea name="BottomBar" position="bottom">
     Bottom
    </cflayoutarea>
</cflayout>

</body>
</html>













More ColdFusion examples

How to create a border type layout in ColdFusion

Introduction

In Adobe ColdFusion, building dynamic web applications involves various tools that allow developers to create intuitive and user-friendly layouts. One such tool is the <cflayout> tag, which offers a way to structure content in different predefined layouts. Among these is the "border" layout, which organizes the page into distinct regions, commonly used in dashboard interfaces or web applications that require a consistent and well-organized structure. This article focuses on creating a border-type layout using ColdFusion’s <cflayout> tag, explaining how to define different regions like the top, left, center, and right sections within a flexible and responsive web page.

A border layout allows developers to divide the webpage into multiple sections, each with a specific purpose, while ensuring a clean and structured presentation. This layout is useful for applications where navigation, main content, and auxiliary content need to be organized into different regions. Let’s break down the example code that demonstrates how to create such a layout in ColdFusion.

Understanding the Border Layout Structure

The core of the border layout in ColdFusion revolves around the <cflayout> tag. This tag defines the overall layout type for the page, with the type="border" attribute indicating that the layout will be divided into distinct areas such as top, left, center, and right. In the provided example, the <cflayout> tag wraps multiple <cflayoutarea> tags, each specifying a different section of the page.

The height and width of the layout are controlled by the style attribute of the <cflayout> tag. In this case, the layout has a height of 400 pixels and a width of 450 pixels. Additionally, the text-align:center style centers the text within these areas, ensuring that the content within each layout region is well-positioned and aligned properly.

Defining Layout Areas

Within the border layout, four main regions are defined using the <cflayoutarea> tag: top, left, center, and right. Each area is given a name and a position to specify where it should appear within the layout. For example:

  • The Top Area is positioned at the top of the layout using position="top" and is set to a height of 75 pixels. This area is often used for headers or navigation bars.
  • The Left Area is positioned on the left side of the layout with a width of 75 pixels. This space is commonly used for side navigation or auxiliary content.
  • The Center Area is the main content area, defined using position="center". It automatically fills the remaining space after the other regions are positioned.
  • The Right Area is positioned on the right side of the layout with a width of 100 pixels. This area could be used for supplementary information, advertisements, or quick links.

By assigning different dimensions and positions to each layout area, you create a flexible structure that divides content into manageable sections.

Customizing the Layout

One of the advantages of using a border layout in ColdFusion is the ability to easily customize each section. In the provided example, inline styles are used to define the height and width of various regions, but developers can extend this customization by adding more styles, such as background colors, fonts, and padding, to create a more visually appealing layout.

Moreover, the names given to each layout area (such as "TopBar", "LeftBar", "CentarBar", and "RightBar") allow for further customization through CSS or JavaScript. For instance, developers can target these specific areas to dynamically change the content or appearance based on user interaction.

Conclusion

ColdFusion’s <cflayout> tag offers a powerful way to structure web pages using a border layout. By defining different sections within the layout, developers can create well-organized and visually appealing interfaces. The border layout is particularly useful in applications that require a structured presentation of content across multiple regions, such as dashboards, control panels, or data-driven applications.

The example provided demonstrates the simplicity and flexibility of creating a border layout in ColdFusion. With a few lines of code, you can organize content into distinct regions, ensuring a clean and professional presentation for your web application. Whether you're building a user dashboard or a complex application interface, the border layout offers a structured approach that enhances both functionality and user experience.


cflayoutBorder.cfm

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cflayout tag: how to create a border type layout in coldfusion</title>
</head>

<body>
<h2 style="color:DimGray; font-style:italic">cflayout example: layout type border</h2>
<hr width="500" align="left" color="LightPink" />
<br />


<cflayout name="BorderLayout" type="border" style="height:400px; width:450px;text-align:center">
 <cflayoutarea name="TopBar" position="top" style="height:75px;">
     Top Area: Height 75px
    </cflayoutarea>
 <cflayoutarea name="LeftBar" position="left" style="width:75px">
     Left
    </cflayoutarea>
 <cflayoutarea name="CentarBar" position="center">
     Center
    </cflayoutarea>
 <cflayoutarea name="RightBar" position="right" style="width:100px">
     Right
    </cflayoutarea>
</cflayout>

</body>
</html>




More ColdFusion tutorials

How to use ColdFusion.Layout.createTab Ajax JavaScript Function

Ajax JavaScript Function - ColdFusion.Layout.createTab

ColdFusionLayoutcreateTab.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Ajax JavaScript Function: how to use ColdFusion.Layout.createTab in coldfusion</title>
</head>

<body>
<h2 style="color:DeepPink; font-style:italic">cfwindow tag example: ColdFusion.Layout.createTab</h2>
<hr width="575" align="left" color="LightPink" />
<br />

<a href="JavaScript:ColdFusion.Layout.createTab('ImageLayout','Tab2','Tree Image','TabSource.cfm')">
 <b>Create New Tab</b>
</a>
<br /><br />

<cflayout name="ImageLayout" type="tab" style="width:550px">
 <cflayoutarea name="ButterflyTab" title="butterfly Image">
     <img src="Images/Butterfly16.jpg" />
    </cflayoutarea>
</cflayout>

</body>
</html>


TabSource.cfm


<img src="Images/Butterfly17.jpg" />














More ColdFusion examples

How to create a Window with custom header style in ColdFusion

Introduction

In Adobe ColdFusion, creating a window with a customized header is a powerful way to enhance the visual appeal and user interface of a web application. The <cfwindow> tag in ColdFusion makes it easy to display a popup window on a web page without needing extensive JavaScript or external libraries. In this example, we’ll walk through how to apply a unique style to the header of a ColdFusion window using the headerstyle attribute of the <cfwindow> tag. This attribute allows developers to modify font size, color, background color, and other CSS properties of the window header.

This guide will break down each part of the example code to help you understand the purpose and usage of each attribute in the <cfwindow> tag. We’ll cover configuring the window’s size, position, and appearance, as well as how to display an image within it. By the end of this guide, you’ll know how to implement your own custom-styled ColdFusion window.

Setting Up the Window Structure

The <cfwindow> tag is the primary element used here to define a popup window. In this example, we create a window named "ButterflyTreeWindow" that is initialized to display immediately upon page load by setting initshow="true". This ensures the window is visible when the page loads, making it useful for displaying welcome messages, notifications, or highlighted content like images or videos. Additionally, the window is given a title of "Butterfly Tree Image," which appears in the header bar of the popup.

Defining Window Position and Size

The window's size is controlled through the height and width attributes, set here to 450 and 550 pixels, respectively. These values are carefully chosen to fit the included image. You can adjust them to fit other content types as needed. The x and y attributes specify the window’s location on the page in pixels, with x="25" and y="100", meaning it will open 25 pixels from the left and 100 pixels from the top of the page. This control over positioning can be essential for optimizing the display across different screen resolutions and devices.

Configuring Resizability and Dragging

In this example, the resizable attribute is set to "false," which disables the user’s ability to resize the window. This is useful when you want to maintain a consistent display for specific content dimensions. Likewise, the draggable attribute is set to "false," preventing the user from moving the window. Together, these settings make the window static, ensuring that the user sees the content exactly as intended without altering the size or position.

Customizing the Header Style

The standout feature in this example is the headerstyle attribute, which is used to apply custom CSS styling to the header of the <cfwindow>. The specified style includes several properties:

  • background-color:RosyBrown; - Sets the header’s background color to a warm RosyBrown shade.
  • font-size:large; - Makes the header font larger for better readability.
  • font-style:italic; - Adds an italic style, enhancing the aesthetic appeal.
  • font-weight:normal; - Ensures the font weight remains at the default level, giving a balanced look.
  • color:Snow; - Changes the text color to Snow, a shade of white that contrasts nicely with the background.

This header style creates a unique, visually pleasing appearance that can help reinforce branding or style continuity within an application. You can adjust these values as needed to match your design requirements.

Displaying Content in the Window

Inside the <cfwindow>, an image tag is used to display a butterfly-themed image sourced from the "Images" folder. This image, "Butterfly12.jpg", has a specified height of 391 pixels and width of 524 pixels. The image’s dimensions are set to match the window size, ensuring it fills the window area without unnecessary space or overflow. This approach is effective for creating attention-grabbing windows that highlight images, infographics, or other visual content.

Conclusion

This example showcases how to create a ColdFusion window with a customized header style, offering control over size, position, and display behavior. By modifying the headerstyle attribute, developers can apply CSS styling directly to the window header, achieving a unique and polished look that integrates seamlessly with the rest of the application. The example also demonstrates how to use the <cfwindow> tag to present images or other content in a controlled popup window, ideal for enhancing user interaction and delivering specialized content.

By following this guide, you should be able to implement similar windows in your own ColdFusion applications, tailoring the attributes to meet specific design and functionality requirements.


cfwindowheaderstyle.cfm

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cfwindow tag: how to create window with custom header style in coldfusion</title>
</head>

<body>
<h2 style="color:SlateGray; font-style:italic">cfwindow tag example: Window Header Style</h2>
<hr width="600" align="left" color="CadetBlue" />
<br />

<cfwindow 
 name="ButterflyTreeWindow" 
    title="Butterfly Tree Image" 
    initshow="true" 
    resizable="false"
    center="false"
    height="450" 
    width="550"
    x="25"
    y="100"
    draggable="false"
    headerstyle="background-color:RosyBrown; font-size:large; font-style:italic; font-weight:normal; color:Snow"
    >
 <img src="Images/Butterfly12.jpg" height="391" width="524"/>
</cfwindow>

</body>
</html>

More ColdFusion examples

How to create a Window with custom body style in ColdFusion

Introduction

In ColdFusion, the <cfwindow> tag is an effective tool for creating visually appealing, interactive windows in web applications. It allows developers to easily add custom modals or popup windows with various attributes like position, size, and style, making it possible to create dynamic user experiences. In this tutorial, we’ll explore how to create a window with a custom body style using the ColdFusion <cfwindow> tag, highlighting key features such as custom background colors, font styles, and other window properties that enhance the overall aesthetic and functionality of the application.

This guide is aimed at ColdFusion developers who want to add more flexibility to their user interfaces. We’ll break down how each attribute in the <cfwindow> tag works and how it contributes to customizing the window's appearance and behavior.

Understanding the <cfwindow> Tag

The <cfwindow> tag in ColdFusion is a powerful tool for creating interactive windows that can display additional content without reloading the main page. These windows function like modals or popup windows, and they are highly customizable with various attributes that control their behavior and appearance. This example showcases how to use the <cfwindow> tag to create a window with a unique body style.

Window Name and Title

The window is identified using the name attribute, which serves as a unique identifier for the window. In this example, the window is named ButterflyTreeWindow. The title attribute sets the text displayed in the window’s title bar, which in this case is "Butterfly Tree Image." These two attributes are crucial for giving context and a recognizable identity to the window.

Initial Display and Resizability

By setting the initshow attribute to true, the window is automatically displayed when the page loads. This attribute is essential when you want the window to appear immediately without any user interaction. Additionally, the resizable="false" setting disables the user’s ability to resize the window, providing a fixed interface that maintains the intended design without distortion.

Positioning and Dimensions

The size and position of the window are controlled using the height, width, x, and y attributes. In this example, the window is set to be 425 pixels in height and 500 pixels in width, ensuring that it comfortably fits the content within. The x and y coordinates define the window's position on the screen, with values of 25 and 100, respectively, ensuring that it is placed at a specific point on the page rather than being centered.

By setting draggable="false", the window is fixed in its position, meaning users cannot move it around the screen. This is useful for maintaining a consistent layout, especially when the window contains important content that needs to stay in a particular location.

Custom Body Style

One of the standout features of this example is the use of the bodystyle attribute to customize the appearance of the window's content. The bodystyle attribute allows developers to apply CSS directly to the body of the <cfwindow>. In this case, a dark DimGray background color is applied, along with bold, gold-colored text. Additionally, the text is centered using text-align:center, which makes the content inside the window look neat and well-organized.

This approach to styling gives developers full control over the window’s presentation, making it possible to match the window’s look to the overall design of the webpage.

Adding Content to the Window

The content inside the window is as flexible as any HTML page. In this example, the text "Butterfly Image" is displayed, followed by an image of a butterfly. The image is given specific dimensions (335px by 400px) to fit nicely within the window’s layout. This demonstrates that the <cfwindow> tag can be used to showcase images, text, forms, or any other HTML content, making it a versatile tool for a variety of use cases.

Conclusion

Using ColdFusion’s <cfwindow> tag provides a straightforward way to create custom, interactive windows with flexible styles and attributes. In this example, we learned how to configure a window’s size, position, and appearance, including applying custom CSS styles to the window body. The result is a polished and user-friendly window that can enhance any web application’s interface.

By mastering these attributes, ColdFusion developers can create windows that not only function well but also align with the visual design of their applications, delivering a more cohesive user experience.


cfwindowbodystyle.cfm

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cfwindow tag: how to create window with custom body style in coldfusion</title>
</head>

<body>
<h2 style="color:SlateGray; font-style:italic">cfwindow tag example: Window Body Style</h2>
<hr width="550" align="left" color="CadetBlue" />
<br />

<cfwindow 
 name="ButterflyTreeWindow" 
    title="Butterfly Tree Image" 
    initshow="true" 
    resizable="false"
    center="false"
    height="425" 
    width="500"
    x="25"
    y="100"
    draggable="false"
    bodystyle="background-color:DimGray; font-weight:Bold; color:Gold; text-align:center"
    >
    Butterfly Image
    <br /><br />
 <img src="Images/Butterfly14.jpg" height="335" width="400"/>
</cfwindow>

</body>
</html>




More coldfusion examples

How to create a Window programmatically with custom settings in ColdFusion

Ajax JavaScript Function - create window programmatically with custom settings

ColdFusionWindowcreateCustom.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Ajax JavaScript Function: how to create window programmatically with custom settings</title>
</head>

<body>
<h2 style="color:Crimson; font-style:italic">Ajax JavaScript Function example: ColdFusion.Window.create</h2>
<hr width="600" align="left" color="CadetBlue" />
<br />

<cfajaximport tags="cfwindow">

<a href="JavaScript:ColdFusion.Window.create('ButterflyWindow','Butterfly Image','Butterfly.cfm',{height:375, width:450,x:25,y:150,draggable:false,closable:false})">
 <b>Show Butterfly Image Window</b>
</a>

</body>
</html>










More ColdFusion examples

How to use ColdFusion.Window.onHide Ajax JavaScript Function

Ajax JavaScript Function - ColdFusion.Window.onHide

ColdFusionWindowonHide.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script language="javascript">
 function onhide(windowName) {
 alert(windowName  + " window now hide!");
 }
 
 function linkClick() {
 ColdFusion.Window.onHide("ButterflyImageWindow", onhide);
 ColdFusion.Window.hide("ButterflyImageWindow");
 }
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Ajax JavaScript Function: how to use ColdFusion.Window.onHide in coldfusion</title>
</head>

<body>

<h2 style="color:DeepPink; font-style:italic">Ajax JavaScript Function example: ColdFusion.Window.onHide</h2>
<hr width="600" align="left" color="Beige" />
<br />

<a href="JavaScript:linkClick()">
 <b>Hide the Window</b>
</a>

<cfwindow 
 name="ButterflyImageWindow" 
    title="Butterfly Image Explorere" 
    initshow="true"
    x="25"
    y="150"
    height="400"
    width="485"
    closable="false"
    draggable="false"
    >
 <img src="Images/Butterfly9.jpg" height="321" width="450" />
</cfwindow>

</body>
</html>














More ColdFusion examples