J'ai un PanelGroup qui est complété avec un backing bean. Il contient des panels grids qui contiennent eux même une liste de commandlink. A chaque commandlink j'associe un param pour pouvoir récupérer l'id. Mes données s'affiche correctement mais quand je clique sur un lien il ne se passe rien....
Voici le code jsp :
Voici le code java:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 <div class="formCadre"> <h:panelGroup binding="#{TerminalPool_1.panelCadre}"/> </div>
Merci de votre aide
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62 private HtmlPanelGroup panelCadre = new HtmlPanelGroup(); public void buildHierarchy(final Group group, final Acceptor acceptor) { getTree().clear(); path.clear(); final List<Group> groups = getHierarchy(group, acceptor); panelCadre.getChildren().clear(); for (Group g : groups) { if (0L == g.getId()) { panelCadre.getChildren().add(createList(manager.getGroups(getSessionBean().getCurrentAcceptorId()))); } else { panelCadre.getChildren().add(createList(manager.getChilds(g.getId()))); } } } public HtmlPanelGrid createList(final List<Group> groups) { final HtmlPanelGrid list = new HtmlPanelGrid(); list.setStyleClass("panelList"); final ExpressionFactory factory = getApplication().getExpressionFactory(); final ELContext elContext = FacesContext.getCurrentInstance().getELContext(); final MethodExpression linkNextAction = factory.createMethodExpression(elContext, "#{TerminalPool_1.linkNextAction}", String.class, new Class[]{}); HtmlCommandLink link; UIParameter param; for (Group g : groups) { link = new HtmlCommandLink(); link.setTitle(g.getDescription()); link.setActionExpression(linkNextAction); link.setValue(g.getName()); param = new UIParameter(); param.setName("selectedGroup"); param.setValue(g.getId().toString()); link.getChildren().add(param); list.getChildren().add(link); } return list; } public String linkNextAction() { System.out.println("List: " + tree); final FacesContext context = FacesContext.getCurrentInstance(); final Group group = getSelectedGroupAndPutItInSession(context); if (!group.getNode()) { return "goToTerminals_1"; } return "goToGroup_1"; } private Group getSelectedGroupAndPutItInSession(FacesContext context) { final Map<String, String> params = context.getExternalContext().getRequestParameterMap(); System.out.println("Group select: " + params.get("selectedGroup")); final Group group = manager.find(Long.valueOf(params.get("selectedGroup"))); return group; }
Partager