I have created a dataTable and associated context menu in backing bean but don't know how to configure rowSelect event listener. Here is part of the code:
DataTable table = (DataTable) application.createComponent(DataTable.COMPONENT_TYPE);
table.setValue(model);
table.setSelectionMode("single");
table.setVar("item");
table.setId("tableId");
:
ContextMenu ctxMenu = new ContextMenu();
ctxMenu.setFor("tableId");
DynamicMenuModel ctxModel = new DynamicMenuModel();
ctxMenu.setModel(ctxModel);
rightCenterPanel.getChildren().add(ctxMenu);
rightCenterPanel.getChildren().add(table);
RequestContext.getCurrentInstance().update(TreeManagedBean.rightCenterForm);
I am looking for equivalent of the following which can be added in backing bean:
<p:ajax event="rowSelect" listener="#{myBean.selectItem}"/>
Also is it possible to add single and double mouse click event listeners for dataTable in the backing bean without adding any " < p:ajax event" in the xhtml file?