I was basically just trying to see if anyone else has had a problem after 
applying that security patch. However code you wants code you gets. This is all 
inside a bigger function but basically this first part send the form to my 
AddToCartAJAX.cfm file which of course adds the item to their cart and it 
returns the ID value for the item in the database. 

My CFWindow has this naming convention. So where the #ID# is would be where the 
ID column from the record is placed. The function callback(text) is where this 
is breaking down. It is working fine until the line that says 
ColdFusion.Window.show(ConfirmWindow) which as you can see from the code is the 
name of the window. Like I said this has been working for over a year now and 
now after this patch all the sudden it can no longer find the window to open 
it. 

I get this error ColdFusion.Window.show: Window not found, id: 
AddToCartWindow54276


My cfwindow
<cfwindow center="true" closable="false" draggable="true" modal="false" 
resizable="true" initShow="false" refreshonshow="true" 
bodyStyle="background-color:white;" headerStyle="background-color:black; 
color:white;" width="600" height="355" name="AddToCartWindow#ID#" 
source="AddToCartWindow.cfm?PID=#ID#" title="Item Was Added To Your Cart" 
destroyonclose="true"></cfwindow>


The AJAX call behind the scenes.

    function submitCart(ID) 
        {
        var frmName = "frm" + ID;
                if(parseInt(document.getElementById(frmName).Quantity.value) <= 
parseInt(document.getElementById(frmName).QtyInStock.value))
                {
                        ColdFusion.Ajax.submitForm(frmName, 
'http://www.domain.com/AddToCartAJAX.cfm', callback, errorHandler);
                }
                else
                {
                        alert("Quanity you are ordering must be equal to or 
less than the quantity in stock. \nPlease try ordering " + 
document.getElementById(frmName).QtyInStock.value + " or less.");
                }
    }

The callback function.
   
    function callback(text) 
    { 
                var results = text;
                var ConfirmWindow = "AddToCartWindow" + text;
                //console.log('running...');
                //console.log(results);
                if(results == 0){
                        
        alert("Callback: " + text);
                }
                else{
                alert("Item was added to your cart.");
                ColdFusion.Window.show(ConfirmWindow);
                }
                //console.log('done...');
    }




-----Original Message-----
From: Andrew Scott [mailto:[email protected]] 
Sent: Thursday, February 07, 2013 6:04 PM
To: cf-talk
Subject: Re: CFWINDOW ID gets changed?


Well without code examples, you might as well try searching for the pin over 
there in the 10 tonne haystack.


--
Regards,
Andrew Scott
WebSite: http://www.andyscott.id.au/
Google+:  http://plus.google.com/113032480415921517411


On Fri, Feb 8, 2013 at 9:59 AM, [email protected]
<[email protected]>wrote:

>
> I know the code was correct. I have it working on a page with a single
> cfwindow and it was working on a page with 100s of cfwindows. It always
> referenced it correctly before. Nothing code wise has changed. The only new
> thing here is the security patch. So I have read the manual on this thanks.
> I have used the console to see that it is passing in the same name as I had
> given it. Yet it says now it can't find that cfwindow. Why is it so hard to
> believe that my code (which has been working fine for over a year) is fine
> and the problem could be an issue with this new patch?
>
>
>
>
> -----Original Message-----
> From: Andrew Scott [mailto:[email protected]]
> Sent: Thursday, February 07, 2013 5:17 PM
> To: cf-talk
> Subject: Re: CFWINDOW ID gets changed?
>
>
> Are you sure?
>
> If you are looking at the source code to the HTML, then that is not an
> indication that it is changing the name. And ColdFusion not Cold fusion
> randomly uses a name in the source so that you may use more than one on the
> current page.
>
> When I asked if you are using the correct way to get the reference to the
> cfwindow object, I am now making the assumption that you are not.
>
> I suggest going back to the ColdFusion docs on the Adobe website, and
> research the JavaScript way to get access to the Windows name. That is the
> correct way to get at the Window, and if you are not doing it this way, I
> am surprised that it has ever worked in the first place.
>
> Sometimes Reading The F'ing Manual is better to do before jumping in here.
>
> --
> Regards,
> Andrew Scott
> WebSite: http://www.andyscott.id.au/
> Google+:  http://plus.google.com/113032480415921517411
>
>
>
> On Fri, Feb 8, 2013 at 9:02 AM, [email protected]
> <[email protected]>wrote:
>
> >
> > Yes. This code has been working fine for over a year. Then after the
> > security update its not. Cold fusion appears to be renaming the window
> and
> > not using the name I gave it
> >
> >
>
>
>
>
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:354374
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to