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
|
private HtmlCommandLink getGroupLink(final Group group) {
final HtmlCommandLink link = new HtmlCommandLink();
link.setImmediate(true);
link.setValue(group.getName());
link.setTitle(group.getDescription());
final FacesContext context = FacesContext.getCurrentInstance();
final ELContext elContext = context.getELContext();
final ExpressionFactory factory = context.getApplication().getExpressionFactory();
final MethodExpression actionMethod = factory.createMethodExpression(
elContext, "#{TerminalPool.processLinkGroupAction}", String.class, new Class[]{});
final MethodExpression listenerMethod = factory.createMethodExpression(elContext,
"#{TerminalPool.listenLinkGroupAction}", null, new Class[]{ActionEvent.class});
link.addActionListener(new MethodExpressionActionListener(listenerMethod));
link.setActionExpression(actionMethod);
link.getAttributes().put("groupId", group.getId());
// final boolean disable = (group.getStatus() == Status.REMOVED) ? true : false;
// System.out.println("Nom: " + group.getName() + " disabled: " + disable);
// link.setDisabled(disable);
return link;
} |