public void encodeChildren(FacesContext context, UIComponent component) throws IOException {
RendererUtils.checkParamValidity(context, component, HtmlCommandJSCookMenu.class);
List list = NavigationMenuUtils.getNavigationMenuItemList(component);
if (list.size() > 0) {
FormInfo parentFormInfo = RendererUtils.findNestingForm(component, context);
ResponseWriter writer = context.getResponseWriter();
if (parentFormInfo == null)
throw new FacesException("jscook menu is not embedded in a form.");
String formName = parentFormInfo.getFormName();
List uiNavMenuItemList = component.getChildren();
/* todo: disabled for now. Check if dummy form stuff is still needed/desired
if( formName == null ) {
DummyFormUtils.setWriteDummyForm(context,true);
DummyFormUtils.addDummyFormParameter(context,JSCOOK_ACTION_PARAM);
formName = DummyFormUtils.getDummyFormName();
}
else {*/
if (RendererUtils.isAdfOrTrinidadForm(parentFormInfo.getForm())) {
// need to add hidden input, cause MyFaces form is missing hence will not render hidden inputs
writer.write("<input type=\"hidden\" name=\"");
writer.write(JSCOOK_ACTION_PARAM);
writer.write("\" />");
}
else {
HtmlFormRendererBase.addHiddenCommandParameter(context, parentFormInfo.getForm(), JSCOOK_ACTION_PARAM);
}
//}
String myId = getMenuId(context, component);