Sets the model representing the dynamic menu stucture to be added to the parent menu, where model is an XML
string containing a structure of menu items.
// 1. build menu XML from table using velocity
var menuxml = VelocityServices.invokeTemplateFromFile("menutest.vm");
controls.DYN1.setModel(menuxml);
// 2. build menu XML using the E4X API
var itemid, itemtext, menuitem;
itemid = "item1";
itemtext = "Item 1";
var menuxml = <menu></menu>;
menuitem = <menuitem></menuitem>;
menuitem.appendChild(<itemname>{itemid}</itemname>);
menuitem.appendChild(<text>{itemtext}</text>);
menuxml.appendChild(menuitem);
itemid = "item2";
itemtext = "Item 2";
menuitem = <menuitem></menuitem>;
menuitem.appendChild(<itemname>{itemid}</itemname>);
menuitem.appendChild(<text>{itemtext}</text>);
menuxml.appendChild(menuitem);
controls.DYN1.setModel(menuxml.toXMLString());
Further documentation
Javascript examples: