1 Reply Latest reply on Jan 18, 2009 4:43 PM by Nick Belaevski

    context menu not appearing on datatable

    Sascha Janz Master

      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);