i got datatable and corresponding contextmenu generated by java code.
but context menu does not appear. what is wrong?
code is
HtmlDataTable table = new HtmlDataTable(); table.setId("TABLE"); table.setColumns(2); table.setRows(10); table.setValueBinding("value", FacesContext .getCurrentInstance().getApplication() .createValueBinding("#{SBean.data}")); table.setVar("data"); ContextMenu ctxmenu = new ContextMenu(); ctxmenu.setAttached(false); ctxmenu.setId("tblmenu"); HtmlMenuItem mitem = new HtmlMenuItem(); mitem.setValue("Edit"); ctxmenu.getChildren().add(mitem); HtmlComponentControl cmpControl = new HtmlComponentControl(); cmpControl.setFor("tblmenu"); cmpControl.setEvent("onRowClick"); cmpControl.setOperation("show"); table.getChildren().add(cmpControl); table.getChildren().add(ctxmenu);
Hello,
Try to move contextMenu and componentControl out of the table.