Icons not displayin in context menu

hi

Can anyone please help. I have a context menu on a tree and it us failing to display any menu icons when I try to load the xml dynamically. However icons display fine when I load it in via the normal static XML way. There is no image path information within the xml file so it should just work.

Please check the code below and tell me what Im doing wrong.

//setup context menu
menu = new dhtmlXMenuObject();
menu.setIconsPath(“icons/”);

         menu.renderAsContextMenu();
         menu.attachEvent("onClick", onButtonClick);
        // menu.loadXML("codebase/xml/_context.xml");
        menu.enableDynamicLoading("webform1.aspx",true);
         myTree.enableContextMenu(menu);

Just a clarifiation on my earlier post…

When I attempt to load the xml file via the loadXML method the icons display fine in my menu. However when I enable a dynamic load script to generate the same xml it fails to displays menu icons.

menu.loadXML(“codebase/xml/_context.xml”); // - this works!!!
menu.enableDynamicLoading(“webform1.aspx”); // this DOES NOT display icons.

The generated XML is exactly the same in both scenarios. When I investigate with firebug there are no containers for the missings icons.

Here’s a snapshop of the XML files

  1. static XML

  2. dynamic XML generated via webform1.aspx

oh shucks what a wally - its so bleeding obvious the difference in the xml is the img attribute. Should be img and not itemimage in the generated script. I changed it and it works now!!!

I spent the best part of a day staring at this and tryin to get it to work. Let this be a lesson to all concerned. When a stupid problem occurs its because the coder is acting stupidly.