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

How do I find an active window in my CF application?

New Here ,
May 15, 2012 May 15, 2012

Hi,

My CF website has 2 tabs (Search tab - reference_search.cfm and Reference tab - reference_input.cfm). When a user searches, it opens up a new window (Multiple Results - reference_search_results.cfm).  From the Multiple Results window, a user may click one record in the list to go to the detail reference page (Reference tab).  Up to this point, my apps is working fine.  Now the user may click another record in the multiple results window (reference_search_results.cfm) to display this record in the Reference tab; however it does not work.

This is the code for the first record display, which works fine -

<a href="javascript:void(0);" onClick="alert(#ReferenceUnitId#);window.opener.parent.parent.document.getElementById('hdnRecordValue').value='#ReferenceUnitId#';window.opener.parent.parent.changeMenu('reference_tab','reference_input.cfm');">#ReferenceUnitId#</a>

The parent of reference_input.cfm is reference_home.cfm.

It does not work when the user clicks another record, #ReferenceUnitId#.  The active tab at this point is the Reference tab but don't know how to get the location of the window.  I tried the following codes inside the reference_search_results.cfm -

alert(window.opener.parent.location.href); //reference_search.cfm?referenceId=-1

alert(window.opener.parent.parent.location.href); //reference_home.cfm

alert(window.location.href);//reference_search_results.cfm

alert(window.parent.location.href); //reference_search_results.cfm?ReportType=Simple

alert(window.focus());//undefined

Thanks.

759
Translate
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
Participant ,
Jun 01, 2012 Jun 01, 2012
LATEST

When a user clicks on a link for the second time, does the content of Reference tab change to the correct content? Is it just an issue with the tab not re-focusing? If that is the case, you could try the following code to re-focus that tab...

Add this to the body of reference_input.cfm.

onLoad="self.focus();"

Another option would be to open a modal window from the reference_search_results.cfm page, like a fancybox window.

Translate
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