ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old February 25th, 2008, 09:09 AM
BenR41 BenR41 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2008
Posts: 3 BenR41 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 30 m 8 sec
Reputation Power: 0
Check to see if a cfwindow exists

Check to see if a cfwindow exists
When a window gets created by <cfwindow> coldfusion gives it a unique name and not the name you assigned it.
I have found a work around in the way of checking for the title of the window as when you create a cfwindow the window title div get the id of yourwinname_title.

(code)

Example javascript
<cfajaximport tags="cfwindow"/>
<script language="javascript">
function createphloadwin() {
if(document.getElementById('mywindow_title')) {
var x = "true";
// Show the window
ColdFusion.Window.show("mywindow");
} else {
var x = "false";
// Create a new window
ColdFusion.Window.create("mywindow", "Upload Photos", "", {height:250,width:400,closable:true,draggable:true,resizable:false,center:true,initshow:true,modal:t rue })
// Put your content in the window or you can assign the url in the ColdFusion.Window.create()
document.getElementById('mywindow_body').innerHTML = 'My Window content';
}
alert(x);
}
</script>

<a href="javascript:createphloadwin();">Check for window</a>

(code/)

Good Luck

Ben
LTS Media Ltd.
Thestreamingmonkey

Reply With Quote
  #2  
Old February 26th, 2008, 11:29 AM
Ebot's Avatar
Ebot Ebot is offline
Meatball Surgeon
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2004
Location: Elbow deep in code
Posts: 1,040 Ebot User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Ebot User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Ebot User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Ebot User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Ebot User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Ebot User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Ebot User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Ebot User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Ebot User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Ebot User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Ebot User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)  Folding Points: 10015 Folding Title: Novice Folder
Time spent in forums: 1 Week 3 Days 3 h 37 m 17 sec
Reputation Power: 462
I don't know if CF does things differently when it creates the CFWINDOW, but can't you just use the window_name.close() feature to close it? Then you should also be able to check if window is open with some JS. If (window_name) then windown_name.close; //checks if the window exists, and if it does, it closes it.
__________________
The liver is evil and must be punished!

Reply With Quote
  #3  
Old February 26th, 2008, 11:58 AM
BenR41 BenR41 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2008
Posts: 3 BenR41 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 30 m 8 sec
Reputation Power: 0
Cf

Hi Ebot,

thanks for the reply

This JS script is to check to see if the cfwindow has been pre-created. As I explained you can't ref a cfwindow by the name assigned to it in the cfwindow tag via JS there is no CFAJAX or CFJS functions to do this. Hence the work around. This has nothing to do with showing and hiding windows there are cf JS functions to do that. If you have an app that creates windows dynamically and you use the cfwindows tag you will end up with a new window every time you hit the same button CF wont destroy and recreate the window.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Check to see if a cfwindow exists


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway