I decided to throw in a couple of additions as well as a solution for a problem some people where having. The first thing I added was a source attribute. This will be an external URL that you can load into a window. You may be asking yourself, what about the autoLoad attribute. Right now the updater will only load files from the same domain and I believe there are security reasons behind that. If you try and pass an external URL to the autoLoad attribute it will not work. That is where the source comes in, it will trick the window and load the URL into and iframe that fills the window. I may remove autoLoad later and based the domain of the source figure out if I should auto load it or throw it in an iframe but we will visit that another time. Here is a quick example of how to use the source attribute.
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
<cfimport prefix="ext" taglib="cfext">
<html>
<head>
<title>cf_window / External SRC Example</title>
<ext:include widget="cfwindow"/>
</head>
<body>
<ext:window id="adobe" title="www.adobe.com" width="800" height="600" modal="true"
closeAction="hide" collapsible="true" bodyStyle="padding:0px;" source="http://www.adobe.com">
</ext:window>
<a href="##" onclick="adobe.show();">www.adobe.com</a>
<br /><br />
</body>
</html>
1<cfimport prefix="ext" taglib="cfext">
2<html>
3<head>
4 <title>cf_window / External SRC Example</title>
5 <ext:include widget="cfwindow"/>
6</head>
7
8<body>
9
10 <ext:window id="adobe" title="www.adobe.com" width="800" height="600" modal="true"
11 closeAction="hide" collapsible="true" bodyStyle="padding:0px;" source="http://www.adobe.com">
12 </ext:window>
13
14 <a href="##" onclick="adobe.show();">www.adobe.com</a>
15 <br /><br />
16
17</body>
18</html>
Next I added some features to the include library. The first is the ability to pass in a theme name. Themes change the appearance of the windows. Right now the only other option is the gray theme so you can just pass in gray as the theme. Also many people were having issues with path issues and the include files. This would happen if you had the cfext folder placed in the root and tried to call the tag from somewhere else in your application. I think (and the jury is still out so let me know) an easy fix for this is to pass in a full path to the cfext folder. An example would be I placed the folder under folder whatever from the root. My Path would be http://www.danvega.org/whatever/. This should just give full paths to the includes and should resolve that issue. Again please let me know for those of you having that problem. Here is an example of combining both of these features.
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
<cfimport prefix="ext" taglib="cfext">
<html>
<head>
<title>cf_window / Full Path</title>
<ext:include widget="cfwindow" path="http://www.danvega.org/examples/" theme="gray"/>
</head>
<body>
<ext:window title="A Basic Window" width="300" height="200">
I am <strong>html</strong>
</ext:window>
</body>
</html>
1<cfimport prefix="ext" taglib="cfext">
2<html>
3<head>
4 <title>cf_window / Full Path</title>
5 <ext:include widget="cfwindow" path="http://www.danvega.org/examples/" theme="gray"/>
6
7</head>
8
9<body>
10
11 <ext:window title="A Basic Window" width="300" height="200">
12 I am <strong>html</strong>
13 </ext:window>
14
15</body>
16</html>
Finally I have added all of these examples to the demo page. Let me know how everything looks. I think I am finally close to focusing on planning out a full library.
http://www.danvega.org/examples/cfwindow/
This entry was posted on January 11, 2008 at 1:08 AM and has received 3282 views. Comments 7 |
Print this entry.
#1 by Trond Ulseth on 1/11/08 - 4:30 AM
I ran into the problem you describe where the cfext was directly under the root, but called from a page deeper down in the site structure.
What I did was change a couple of lines in the include.cfm code. I changed
<script type="text/javascript" language="javascript" src="cfext/ext/window.js"></script>
<link href="cfext/ext/resources/css/ext-all.css" type="text/css" rel="stylesheet"/>
to
<script type="text/javascript" language="javascript" src="/cfext/ext/window.js"></script>
<link href="/cfext/ext/resources/css/ext-all.css" type="text/css" rel="stylesheet"/>
And that solved the problem for me. Now it will run only if cfext is directly under the root, but that is not an issue for me.
It's probably not a big thing to make it figure out the correct path at runtime either, just I am lazy and took the easy way out :)
#2 by Michael Brennan-White on 1/11/08 - 8:18 AM
#3 by Dan Vega on 1/11/08 - 8:21 AM
<ext:window id="mywindow">
</ext:window>
<a href="##" onclick="mywindow.show()">Show Window</a>
<a href="##" onclick="mywindow.hide()">Hide Window</a>
If that does not work for you let me know!
#4 by Nicole Rutter on 3/21/08 - 1:48 PM
<cfoutput query="myList">
#myList.myID#
<ext:include widget="cfwindow"/>
<ext:window id="windowa#myList.myID#" title="Window A" width="600" height="400" collapsible="true" closeAction="hide">
<table width="300" border="1" cellpadding="0" cellspacing="0">
<tr>
<td>List</td>
</tr>
</table>
<table width="300" border="1" cellpadding="0" cellspacing="0">
<tr>
<td>My ID:#myID.id#</td>
<td>Customer Name:#myID.name#</td>
</tr>
</table><br/>
</ext:window>
<a href="##" onclick="windowa#myList.myID#.show();">Window A</a>
<br /><br />
</cfoutput>
#5 by Dan Vega on 3/21/08 - 1:52 PM
#6 by Igor Mazor on 11/16/08 - 11:42 AM
#7 by AKi on 4/20/09 - 12:55 PM