Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Find more inspiration, events, and resources on the new Adobe Community
Explore Now