String evt = (String) component.getAttributes().get("event");
if(evt == null || evt.trim().length() == 0){
evt = "onmouseover";
}
function.addParameter(evt);
ScriptOptions subMenuOptions = new ScriptOptions(component);
subMenuOptions.addEventHandler("onopen");
subMenuOptions.addEventHandler("onclose");
subMenuOptions.addOption("direction");
subMenuOptions.addOption("dummy", "dummy");
function.addParameter(subMenuOptions);
function.appendScript(buffer);
} else {
buffer.append(".");
function = new JSFunction("asContextMenu");
/* function.addParameter(component.getParent().getClientId(context));
String evt = (String) component.getAttributes().get("event");
if(evt == null || evt.trim().length() == 0){
evt = "oncontextmenu";
}
function.addParameter(evt);
function.addParameter("onmouseout");
*/ ScriptOptions menuOptions = new ScriptOptions(component);
menuOptions.addOption("direction");
menuOptions.addOption("jointPoint");
menuOptions.addOption("verticalOffset");
menuOptions.addOption("horizontalOffset");
menuOptions.addEventHandler("oncollapse");
menuOptions.addEventHandler("onexpand");
menuOptions.addEventHandler("onitemselect");
menuOptions.addEventHandler("ongroupactivate");
menuOptions.addOption("dummy", "dummy");
function.addParameter(menuOptions);
function.appendScript(buffer);
}