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

cfmenu won't handle cfifs

Engaged ,
Aug 10, 2009 Aug 10, 2009

Greetings-

I'm attempting to build out a dynamic menu using a simple cfquery and nesting cfmenuitem tags inside of a cfmenu tag. Hardcoding this code works fine, but when I attempt to use cfif statements within the cfmenu tags to dynamically include or exclude menuitems I get the following behavior:

The only condition I've been able to get CF to view and recognize while nested within the cfmenu tags is a numeric comparison (cfif 1 LT 2). Then my menuitem appears.

If I use something a little more traditional like (cfif qName.value CONTAINS "expected value") or (cfif qName.value IS "expected value") the values never appear as expected.

Yes, I've pulled the cfifs out of the cfmenu tags and tested the raw conditions, and the conditions are true and will print/dump to screen, so the conditions are not the suspect.

Does anyone know of any limitations/restrictions/workarounds to build dynamic cfmenus using a query? I wasn't able to pull up anything online....

Thanks in advance,

Rich

938
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
Valorous Hero ,
Aug 10, 2009 Aug 10, 2009

Some simple code examples of what you are trying to do is always helpful for questions like this....

Without any idea of what you tired, I can only advise that when using the new AJAX features like <cfdiv...> <cfmenu>, etc, you are mixing server side logic that is written in CFML like <cfif...> and JavaScript that is written in ECMA script.

So it is possible that you may need to write the logic you are trying to execute in JavaScript.

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
Engaged ,
Aug 10, 2009 Aug 10, 2009
LATEST

Thanks Ian, I'll give it a try.

Sometimes you get so caught up in stuff and the way it's *supposed* to work you can't see the forest through the trees....

I'll post back when I've had a chance to try some conditional javascript.

Thanks again,

Rich

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