<?phpclass Menu05 extends Page { public function InitializeComponent() { parent::$PAGE_TITLE = "Tutorial : Context menu"; $menu_object = new WSPObject("Click right button"); $menu_object->setId("obj_menu_5"); $menu_object->setStyle("border:1px dashed gray;". "padding:5px;"); $context_menu = new ContextMenu("context_menu_5"); $context_menu->addItem("Menu 1", ContextMenu::CONTEXTMENU_ICON_LINK, $add_folder_event); $menu_event = new ContextMenuEvent($this); $menu_event->onClick("clickEvent")->setAjaxEvent(); $context_menu->addItem("Menu 2", ContextMenu::CONTEXTMENU_ICON_REDO, $menu_event); $menu_object->setContextMenu($context_menu); $this->render = $menu_object; } public function clickEvent($sender, $object) { alert($object->getId()); }}?>