0

I am attempting to popup a cfwindow in the center (or near where I click the mouse) of a very long list of names. I have no problems getting the window to popup the first time in the middle of where ever I have scrolled to but after closing/hiding the window - subsequent clicks on different names shows the window at the same location as first opened and not in the middle of where the page has scrolled to. How do I get the window to always open at the center of the page regardless of where I have scrolled down to and regardless of how many times I have already clicked to pop open the cfwindow?

<cfwindow  name="wRally" title="View Rally Hours" 
    source="index.cfm?action=rally_hours&id={mainform:DYN_FORM_VAL}" 
    height="500" width="500"  
    bodystyle="margin-left: 0px; margin-top: 0px; padding-top: 0px; 
       padding-left: 0px; background-color: ffffff;" 
    refreshonshow="True" center="true" closable="true" draggable="true" ></cfwindow>

<script language="javascript">  
    function viewRally(myVAL) {
        mainform.DYN_FORM_VAL.value = myVAL;
        ColdFusion.Window.show("wRally");
    }
</script>

onClick="viewRally('EMPLOYEE_ID_123');"
James A Mohler
  • 11,060
  • 15
  • 46
  • 72
Torsten
  • 29
  • 3
  • what is onClick in side of? – James A Mohler Nov 15 '13 at 02:03
  • 2
    Don't use `cfwindow` or any other UI functionality of ColdFusion. The libraries are often out of date, never updated and, in most cases, more difficult to use than their 'native' counterparts. You should use jQueryUI or ExtJS directly. You will thank for this advice later. – Scott Stroz Nov 15 '13 at 12:59

1 Answers1

1

You might need to destroy and recreate the window each time see http://www.raymondcamden.com/index.cfm/2008/9/26/Ask-a-Jedi-Another-CFWINDOW-Example.