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

cfmenuitems no longer work after coldfusion.navigate

Explorer ,
Sep 15, 2011 Sep 15, 2011

There are times when you want to make slight changes to menus based on what a user does.  It would be nice to simply "refresh" the menu (likely a cfdiv containing a cfmenu) using ColdFusion.navigate(..).  However, if your menu contains cfmenuitems, they no longer appear ("drop down") after performing the navigate. If this is the intended behavior I think it is a major limitation.  (CF9 and CF8)

code for my_test.cfm:

<cfajaximport />

<cfdiv id="myDiv">

<cfmenu name="my_menu" type="horizontal">

<cfmenuitem name="options" display="My Options">

<cfmenuitem name="option1" display="Option 1" href="javascript:ColdFusion.navigate('my_test.cfm','myDiv')" />

<cfmenuitem name="option2" display="Option 2" href="javascript:ColdFusion.navigate('my_test.cfm','myDiv')" />

<cfmenuitem name="option3" display="Option 3" href="javascript:ColdFusion.navigate('my_test.cfm','myDiv')" />

</cfmenuitem>

</cfmenu>

</cfdiv>

598
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

correct answers 1 Correct answer

Explorer , Sep 20, 2011 Sep 20, 2011

It turns out that if you remove any one of the cfmenuitem elements prior to doing the navigate the cfmenuitems work correctly...

<cfajaximport />

<script type="text/javascript">

  function myNav() {

            removeElements();

            ColdFusion.navigate('my_test.cfm','myDiv');

  }

  function removeElements() {

          var d = document.getElementById('myDiv');

          var e = document.getElementById('option1');

          d.removeChild(e);

}

</script>

<cfdiv id="myDiv">

  <cfmenu name="my_menu" type=

...
Translate
Explorer ,
Sep 20, 2011 Sep 20, 2011
LATEST

It turns out that if you remove any one of the cfmenuitem elements prior to doing the navigate the cfmenuitems work correctly...

<cfajaximport />

<script type="text/javascript">

  function myNav() {

            removeElements();

            ColdFusion.navigate('my_test.cfm','myDiv');

  }

  function removeElements() {

          var d = document.getElementById('myDiv');

          var e = document.getElementById('option1');

          d.removeChild(e);

}

</script>

<cfdiv id="myDiv">

  <cfmenu name="my_menu" type="horizontal">

  <cfmenuitem name="options" display="My Options">

  <cfmenuitem name="option1" display="Option 1" href="javascript:myNav();" />

  <cfmenuitem name="option2" display="Option 2" href="javascript:myNav();" />

  <cfmenuitem name="option3" display="Option 3" href="javascript:myNav();" />

  </cfmenuitem>

  </cfmenu>

</cfdiv>

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