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

Error using ColdFusion.Navigate

New Here ,
Apr 05, 2010 Apr 05, 2010

I am getting the following error when I click on a specific cfmenu link:

Error processing JavaScript in markup for element cf_layoutareamyContent

Here is the link:

<cfmenuitem name="rpts" href="javaScript:ColdFusion.navigate('reports.cfm','myContent');" display="Reports" />

After clicking OK on the error the page displays as expected and the link to the cfwindow works as well.  However when I click the home menu itema nd then click this menu item again the screen goes blank.  Any ideas?

cfdebug output:

error:http: Error processing JavaScript in markup for element cf_layoutareamyContent:

Thanks in advance!

-David

3.5K
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
Enthusiast ,
Apr 06, 2010 Apr 06, 2010

Are you working with CF9?

There's an incompability (I call it a bug) between CF8 and CF9.

In CF9, You cannot target a ColdFusion.navigate() into a layoutarea.

http://cfbugs.adobe.com/cfbugreport/flexbugui/cfbugtracker/main.html#bugId=79960

Apparently it's not going to be fixed in the near future.

The best solution is to place a CFDIV right within your layoutarea with an ID of choice, and  target the link there. That works both in CF8 and 9.

--

-Fernis - fernis.net - ColdFusion Developer For Hire

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
New Here ,
Apr 06, 2010 Apr 06, 2010

Cna you give me an example if <cfdiv> and where I put it and how to link to it

as I haven't used this tag before?

Thanks!

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
Enthusiast ,
Apr 06, 2010 Apr 06, 2010

<cflayout...


<cflayoutarea name="myContent_renamed"... >

     <cfdiv id="myContent">

     </cfdiv>

</cflayoutarea>

</cflayout>

There's nothing special to it. Just add <CFDIV></CFDIV> inside the LAYOUTAREA.

Give the layoutarea some other name, since you actually never will target anything directly to it. But since you have the cfdiv right inside the layoutarea, it's virtually the same as if you were.

-Fernis

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
New Here ,
Apr 06, 2010 Apr 06, 2010

Here is my onClick for the radio button, is this still the same as well?

onClick="javascript:ColdFusion.navigate('dash_mtf.cfm', 'mtfContent');"

I still get that javascript error when I click the radio button.  Damn!

<cflayoutarea position="center" name="Content">
     <cfdiv id="mtfContent" />
</cflayoutarea>

Thanks for your help and assistance.

-David

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
Enthusiast ,
Apr 06, 2010 Apr 06, 2010

It should work fine.

Here's an example which works for me:

<cflayout type="border">
<cflayoutarea position="top" name="b_top">
<cfform name="myform">
<cfinput type="radio" name="myradio" value="1" onclick="javascript:ColdFusion.navigate('dash_mtf.cfm', 'mtfContent');"> Click me
</cfform>
</cflayoutarea>

<cflayoutarea position="center" name="b_center">
<cfdiv id="mtfContent"/>
</cflayoutarea>
</cflayout>

Check with cfdebug=true, Ajax debugging enabled, that you're not getting ColdFusion errors anywhere.

-Fernis

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
New Here ,
Apr 06, 2010 Apr 06, 2010

Yep, still getting errors (3) from cfdebug:

error:http: Error processing JavaScript in markup for element mtfContent:

error:http: Error processing JavaScript in markup for element mtfContent:

error:http: Error processing JavaScript in markup for element mtfContent:

Can it be a nesting issue maybe?

index.cfm has a menu in a top cflayoutarea (Dashboard), <cflayoutarea position="center" name="myContent">

When dashboard is clicked:   <cfmenuitem name="dash" href="javaScript:ColdFusion.navigate('dashboard.cfm','myContent');" display="Dashboard" />

Dashboard.cfm contains the following:

<cflayout type="border">

    <cflayoutarea position="left" size="155" name="dashmenu">
          <cfinput type="radio" name="myradio" value="1" onclick="javascript:ColdFusion.navigate('dash_mtf.cfm', 'mtfContent');">Click Me

    </cflayoutarea>

    <cflayoutarea position="center" name="b_content">
          <cfdiv id="mtfContent" />
     </cflayoutarea>

</cflayout>

dash_mtf.cfm contains HTML tables with data and charts.

What do you think?

-David

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
Enthusiast ,
Apr 06, 2010 Apr 06, 2010
LATEST

http://www.coldfusionguy.com/ColdFusion/blog/index.cfm/2008/1/21/JavaScript-Error-from-CFChart-within-CFLayout

Haven't tried that myself, but I know that's a common issue. The last messages in the thread should help you most.

Sorry I can't help you right away with an example - too busy coding other stuff.

-Fernis

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