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

cfwindow bug when more than one on page

Explorer ,
Nov 21, 2008 Nov 21, 2008

Copy link to clipboard

Copied

I have a complex data entry page in which I use the cfwindow tag several times to produce 3 different modal windows. Cfwindow is being used to provide access to lookup tables for several different fields in a form (the cfwindow tags, however, are employed on the page outside the form tags), so there is a different cfwindow for each field and each cfwindow has a unique name attribute value.

Much of the time, this works fine. But perhaps one out of four times that I refresh the page, cf appears to get confused about which cfwindow to open. One cfwindow is named MetroAirports, another is named Coordinators and a third other is named CommunityCounselor. I've attached some of the javascript that CF produces when the page is rendered. You'll note that CF creates a _cf_window_init.. variable for each window.

Note that the value of this variable is the same for the second two windows: 1227286702850. To the end user, the result is that CF will not produce the second window, CommunityCoordinators, properly; it's size and formatting is messed up. And when it it closed, it won't close properly (it appears to "partially" close, leaving the rest of the page inaccessible).

I can reproduce this problem...but as I mentioned, it only happens 25-30% of the time. Anyone have any clues as to what is going on here?
TOPICS
Advanced techniques

Views

453

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
Explorer ,
Nov 21, 2008 Nov 21, 2008

Copy link to clipboard

Copied

LATEST
Okay, as usual, I'm solving my own problems, heheh. Probably best this way though...

The problem is that there is a bug in cfwindow when calling it from inside a custom tag when you use the tag more than once on a given page.

When CF produces a page on which you have used cfwindow, CF includes a bunch of ext-and-related javascripts in the page and it creates special divs--each uniquely named--for each cfwindow you've defined. When you use cfwindow multiple times to produce different-named windows on the same page, CF is smart about only including these ext JS script files only once.

But when you are calling cfwindow from inside a custom tag, it appears that CF will include the same ext scripts once for each time you use cfwindow; probably because each instance of usage is "unaware" of any other uses of cfwindow because the custom tag "isolates" them from the rest of the code in the page. Eventually CF "gets confused" and starts naming the divs incorrectly.

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