• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Destroy a cfwindow

Guest
Jul 06, 2008 Jul 06, 2008

Copy link to clipboard

Copied

Hi all,

Given the trouble I mentioned in my "bind failed, element not found" post on 7/3, I'd like to just destroy a js-created cfwindow when it's hidden (using the onhide event), and create a new one each time. Does anyone know how to destroy a cfwindow. I would have thought it would be along the lines of:

ColdFusion.Window.getWindowObject('MyWindow').destroy();

But that doesn't work.

Thanks,
Russ

Views

2.7K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 06, 2008 Jul 06, 2008

Copy link to clipboard

Copied

cose, very close!

from cf 8.0.1 release notes:

"You can now use the following ColdFusion AJAX JavaScript function,
which destroys a window instance:
ColdFusion.Window.destroy(windowName[, destroyElement])
- windowName The name of the window to destroy
- destroyElement A Boolean value specifying whether the HTML element
associated with the window should also be destroyed. The default value
is false."

this is only available in cf 8 Update 1 (cf8.0.1) - not in cf8.

hth

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 07, 2008 Jul 07, 2008

Copy link to clipboard

Copied

Thank you so much, Azadi. I'll give that a shot.

Russ

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 05, 2009 Mar 05, 2009

Copy link to clipboard

Copied

I *am* running 8.0.1 and this does not work as expected. First time I open the window, everything works fine. Subsequent attempts to open other windows with the same name result in window title at the top and all else blank. I can still only use the window for the one attempt.

Here is my code:
<CFAJAXIMPORT TAGS="CFWINDOW">
...

try {
ColdFusion.Window.destroy('WindowName',true);
} catch(e) {}

...

ColdFusion.Window.create('WindowName', 'Window Title','[url here]', config_string);

...

Is anyone aware of further issues? Most of the information I have found predates 8.0.1...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 08, 2010 Jul 08, 2010

Copy link to clipboard

Copied

I tried destroying a window and recreating to solve my original problem, after updating to 8.0.1, but it doesn't solve the problem (must be same old window).

http://forums.adobe.com/message/2950095#2950095

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 20, 2011 Jul 20, 2011

Copy link to clipboard

Copied

You can only hide the window

ColdFusion.Window.hide('myWindow');

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 20, 2014 Nov 20, 2014

Copy link to clipboard

Copied

LATEST

Try this way, works fine for me.

ColdFusion.Window.create(....);

ColdFusion.Window.onHide("windowName",function(){

                                                                           ColdFusion.Window.destroy("windowName")});

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation