1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
public HtmlDropDownMenu getAdminRefMenu() {
HtmlDropDownMenu menu = new HtmlDropDownMenu();
menu.setValue("table reference");
menu.setDirection("bottom-right");
menu.setJointPoint("tr");
FacesContext ctx = FacesContext.getCurrentInstance();
Application app = ctx.getApplication();
for (RefAdminBean entry : listRefs) {
HtmlMenuItem menuItem = new HtmlMenuItem();
String subOption = entry.getNomTable();
menuItem.setValue(subOption);
Class[] params = {};
MethodExpression actionExpression = app.getExpressionFactory().createMethodExpression(ctx.getELContext(),
"#{administration.adminRefAction}", String.class, params);
menuItem.setActionExpression(actionExpression);
menu.getChildren().add(menuItem);
}
return menu;
} |
Partager