User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ColdFusion section within the Web Development category of DaniWeb, a massive community of 373,378 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,683 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ColdFusion advertiser:
Views: 639 | Replies: 0
Reply
Join Date: Feb 2008
Posts: 2
Reputation: BenR41 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
BenR41 BenR41 is offline Offline
Newbie Poster

Check to see if a cfwindow exists

  #1  
Feb 25th, 2008
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.

Example javascript
  1. <cfajaximport tags="cfwindow"/>
  2. <script language="javascript">
  3. function createphloadwin() {
  4. if(document.getElementById('mywindow_title')) {
  5. var x = "true";
  6. // Show the window
  7. ColdFusion.Window.show("mywindow");
  8. } else {
  9. var x = "false";
  10. // Create a new window
  11. ColdFusion.Window.create("mywindow", "Upload Photos", "", {height:250,width:400,closable:true,draggable:true,resizable:false,center:true,initshow:true,modal:true })
  12. // Put your content in the window or you can assign the url in the ColdFusion.Window.create()
  13. document.getElementById('mywindow_body').innerHTML = 'My Window content';
  14. }
  15. alert(x);
  16. }
  17. </script>
  18.  
  19. <a href="javascript:createphloadwin();">Check for window</a>
Thanks

Ben
LTS Media Ltd.
>url snipped<
Last edited by MattEvans : Feb 25th, 2008 at 10:48 am. Reason: Use [code] tags around blocks of code; don't post website URLs in a 'fake' signature.
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb ColdFusion Marketplace
Thread Tools Display Modes

Other Threads in the ColdFusion Forum

All times are GMT -4. The time now is 3:12 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC