Avatar of Lee R Liddick Jr
Lee R Liddick Jr
Flag for United States of America asked on

CFWINDOW causing "Error processing JavaScript..."

Every time I click on the image that fires the onclick javascript for CFWINDOW I get the following message:
("Error processing JavaScript in markup for element crdata_body: [Enable debugging.....]")

Now, I only get this the first time I click on the image button.  But when I refresh the page and click on my image button again, I get the error again.

<CFAJAXIMPORT TAGS="cfwindow">
<cfwindow x="210" y="100" width="960" height="500" name="crdataedit"
        title="Call Routing Data" initshow="false"
        source="windowTestedit.cfm"
        modal="true" />
<cfwindow x="210" y="100" width="960" height="500" name="crdataview"
        title="Call Routing Data" initshow="false"
        source="windowTestview.cfm"
        modal="true" />

<IMG SRC="../images/btn_edit2.gif" TITLE="Edit CDN/VDN" STYLE="cursor:hand;" ONCLICK="javascript:ColdFusion.Window.show('crdataedit')">
<IMG SRC="../images/btn_view2.gif" TITLE="View CDN/VDN" STYLE="cursor:hand;" ONCLICK="javascript:ColdFusion.Window.show('crdataview')">

Open in new window

Web ServersJScriptAJAXColdFusion Language

Avatar of undefined
Last Comment
Lee R Liddick Jr

8/22/2022 - Mon
cfEngineers

onclick assumes that you are using javascript so change

ONCLICK="javascript:ColdFusion.Window.show('crdataedit')">

to

ONCLICK="ColdFusion.Window.show('crdataedit')">
Lee R Liddick Jr

ASKER
I tried that...still get the same message.
cfEngineers

In one if your windowTestedit or windowTestview cfm files, you most likely have some javascript functions that look like this

function test(id){
}

when they should look like this

test = function(id){
}

This is known to cause JS errors in CF using AJAX.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Lee R Liddick Jr

ASKER
This is really all I have in the test files right now...
<!---- content of windowTestview.cfm file ----->
<html>
<head>
<link rel="stylesheet" type="text/css" href="../css/screen.css">
</head>
<body style="width:850;">
<CFAJAXIMPORT TAGS="cflayout-tab,cfform,cfwindow">
<h3>Main page input:</h3>
<CFLAYOUT TYPE="TAB" TABHEIGHT="100%">
    <CFLAYOUTAREA name="tab1" TITLE="Basic Data">
        Put all the basic information about the VDN here.
    </CFLAYOUTAREA>
    <CFLAYOUTAREA name="tab2" TITLE="Hours of Operation">
        Put the Hours of Operation data here.
    </CFLAYOUTAREA>
    <CFLAYOUTAREA name="tab3" TITLE="Technical Data">
        Put the technical data of the VDN here.
    </CFLAYOUTAREA>
</CFLAYOUT>
</body>
</html>

Open in new window

cfEngineers

Put all your cfajaximport tags in the main page
gdemaria

The CFAJAXIMPORT  belongs in your main page, not in the page that uses cflayout.

Also, you don't need to reference cfwindow because it is in the main page (assuming that is the main page).

and remove CFAJAXIMPORT from your windowTestEdit.cfm file


<CFAJAXIMPORT TAGS="cflayout-tab,cfform">
<cfwindow x="210" y="100" width="960" height="500" name="crdataedit"
        title="Call Routing Data" initshow="false"
        source="windowTestedit.cfm"
        modal="true" />
        
<cfwindow x="210" y="100" width="960" height="500" name="crdataview"
        title="Call Routing Data" initshow="false"
        source="windowTestview.cfm"
        modal="true" />

<IMG SRC="../images/btn_edit2.gif" TITLE="Edit CDN/VDN" STYLE="cursor:hand;" ONCLICK="javascript:ColdFusion.Window.show('crdataedit')">
<IMG SRC="../images/btn_view2.gif" TITLE="View CDN/VDN" STYLE="cursor:hand;" ONCLICK="javascript:ColdFusion.Window.show('crdataview')">

Open in new window

⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Lee R Liddick Jr

ASKER
Okay...I removed the CFAJAXIMPORT off the windowTest pages.  I removed the cfwindow from the CFAJAXIMPORT on the main page (data_manager.cfm).  Still getting the popup error.  Does the CFAJAXIMPORT tag need to be in a specific place on the file or something?  
gdemaria

add &cfdebug=1  to the URL and try again,  a window should appear that will show you a better error

The error may be in your test.cfm pages, it could be a simple type-o.  You can try reducing those pages to just "hello world" and see if that works as a quick test...  (comment out the rest)
Lee R Liddick Jr

ASKER
I have tried the ?cfdebug=1 and ?cfdebug=true before and nothing would ever popup.  I have commented out everything off my windowTest page and just put Hello World... and I still get the same popup error...  
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
gdemaria

Make sure you have the debugging turned on in your /CFIDE/administrator

I would leave the Hello World in the test page until we get the error sorted out, just to reduce possible factors.   Because if the called page has an error, you could see a pop-up error like that.

I notice the error is mentioning  crdata_body rather than crdataEdit_body.  The cfwindow's name is crdataedit, I am wondering why it says crdata_.... instead, do you have anything called crdata on the page as well?

Lee R Liddick Jr

ASKER
I have asked our administrator to turn it on...

and that was a typo...the error is crdataEdit_body.  I double checked my code and the cfwindow and the window.show shows the same.
Lee R Liddick Jr

ASKER
The code below is my main page 'data_manager.cfm' and my window page 'windowContentA.cfm' code.  This is what I get in the AJAX Logger window when I click on the main page link to the window:

info:http: Replaced markup for element: crdedit_body
error:http: Error processing JavaScript in markup for element crdedit_body:
info:widget: Window shown, id: crdedit
info:http: HTTP GET windowContentA.cfm?_cf_containerId=crdedit_body&_cf_nodebug=true&_cf_nocache=true&_cf_clientid=F1DC1A1496BFE163D562F5BDC5D0FDC1&_cf_rc=0
info:http: Replacing markup for element: crdedit_body from URL windowContentA.cfm with params _cf_containerId=crdedit_body
info:widget: Creating window: crdedit
info:LogReader: LogReader initialized
info:global: Logger initialized

<!--- main page, data_manager.cfm ----->
<CFAJAXIMPORT TAGS="cflayout-tab,cfform">
<cfwindow x="210" y="100" width="960" height="500" name="crdedit"
        title="Call Routing Data" initshow="false"
        source="windowContentA.cfm"
        modal="true" />

<IMG SRC="../images/btn_edit2.gif" TITLE="Edit CDN/VDN" STYLE="cursor:hand;" ONCLICK="javascript:ColdFusion.Window.show('crdedit')">

<!---- contents of windowContentA.cfm ----->
Hello World...
<!---- I also have rem out 
<h3>Main page input:</h3>
<CFLAYOUT TYPE="TAB" TABHEIGHT="100%">
    <CFLAYOUTAREA name="tab1" TITLE="Basic Data">
        Put all the basic information about the VDN here.
    </CFLAYOUTAREA>
    <CFLAYOUTAREA name="tab2" TITLE="Hours of Operation">
        Put the Hours of Operation data here.
    </CFLAYOUTAREA>
    <CFLAYOUTAREA name="tab3" TITLE="Technical Data">
        Put the technical data of the VDN here.
    </CFLAYOUTAREA>
</CFLAYOUT>
----->

Open in new window

⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Lee R Liddick Jr

ASKER
Does any of this make sense?
Lee R Liddick Jr

ASKER
Does anyone care at this point?  Hahahahahaha
Lee R Liddick Jr

ASKER
Should I give up at this point and find another way to do this?  This makes no sense as to why it doesn't work and throws up that error.  I have searched and searched over the net and I have coded it exactly the way I have it.  No other code is bumping off of it becuase it's the only code on the pages.  None of the other suggestions in any of the other blog and posting sites have worked for me.  Is there another way to get the 'modal' type window to work other than CFWINDOW?
Your help has saved me hundreds of hours of internet surfing.
fblack61
gdemaria


Sorry, I was away.  

I took your code and set it up on my server to give it a test.   I got the same error when I did not have the windowContentA.cfm  created yet.    But after the pop-up error, the screen showed the debug informaton "File Not Found..."   Do you have coldfusion debugger on?   I would think you would see the error message (or a different one) as well.   This is the regular debugger that shows the queries and execution code at the bottom of every page..  is that on?

When I put the file in place, everything worked perfectly.   Check to see if your file is in the same folder as your cfwindow file.   If not add a relative path to the pop-up file.

If this doesn't work, make sure debugger is on and look for error message on the screen.  Also, let me know what folder the two files are in.
Lee R Liddick Jr

ASKER
Not a problem...My cf debugger was on but its off now...it is a shared server and the company turns it off after the day...i have to submit another ticket to get them to turn it back on.  In any case, I didn't see any errors in the cf debugger.  My windowContentA.cfm file is in the same folder as the data_manager.cfm.  I'm at a loss at this point.
gdemaria


I was rereading the thread and noticed that you said the error only happens the first time you click the button (first time on each page load).   Is that still the case?   If so, what if you wait a few extra seconds before clicking it?  Perhaps the js libraries are loading slowly?
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
cfEngineers

try adding cfwindow to <CFAJAXIMPORT TAGS="cflayout-tab,cfform">
Lee R Liddick Jr

ASKER
That is correct...and I just waited about 3-4 minutes after the page loaded.  No change.
Lee R Liddick Jr

ASKER
@cfEngineers...I have done that, no change.  

I have even moved my two test pages to my production site and tried it there too...still the same thing.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
cfEngineers

Because you are calling javascript ColdFusion.Window. you have to have cfwindow in your <CFAJAXIMPORT TAGS="cflayout-tab,cfform">

cfEngineers

set your initshow to true for both to see if they show up without error
Lee R Liddick Jr

ASKER
I have already set the initshow to true and same thing...
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
gdemaria

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Lee R Liddick Jr

ASKER
Using the CFINCLUDE did it...for goodness sakes.  Thanks for the persistance...I wish I could give more points out for this!
Lee R Liddick Jr

ASKER
Such persistance in assisting with this!  Thank you so much!!!
gdemaria

Phew!  Glad it worked.

Just a note about CFAJAXIMPORT, a lot of things were tried here, so to just clear that up.  CFAJAXIMPORT goes into the main file and only needs to reference CF ajax components that are inside of the CFWINDOW.   So if your WindowContentA.cfm file calls a layout tab or a CFform, you need to include those two elements in your CFAJAXIMPORT.  

Hope that makes sense.

Regards,
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Lee R Liddick Jr

ASKER
Yes it does...thanks again qdemaria!