1 pièce(s) jointe(s)
Comment récupérer la valeur d'un commandLink ?
Bonjour,
Je veux récupérer la valeur d'un commandLink, mais je trouve pas la solution pour cela:
Code:
1 2 3 4 5 6 7 8
|
<h:commandLink immediate="true"
styleClass="#{t.nodeSelected ? 'documentSelected':'document'}"
actionListener="#{t.setNodeSelected}">
<t:graphicImage value="images/document.png" border="0"/>
<h:outputText value="#{node.description}"/>
<f:param name="docNum" value="#{node.identifier}"/>
</h:commandLink> |
http://www.developpez.net/forums/att...1&d=1311328575
Par exemple lorsque l'utilisateur clique sur le nœud _virt_depart, je veux récupérer la valeur du nœud pour l'utiliser par la suite dans des autres traitements.
Le fichier XHTM de la page:
Code:
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
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:t="http://myfaces.apache.org/tomahawk">
<body>
<ui:composition template="/META-INF/templates/template.xhtml">
<ui:define name="body">
<h:form id="foo">
<t:tree2 id="clientTree" value="#{treeBacker.treeData}" var="node" varNodeToggler="t">
<f:facet name="corbeille">
<h:panelGroup>
<h:commandLink immediate="true" styleClass="#{t.nodeSelected ? 'documentSelected':'document'}" actionListener="#{t.setNodeSelected}">
<t:graphicImage value="images/document.png" border="0"/>
<h:outputText value="#{node.description}"/>
<f:param name="docNum" value="#{node.identifier}"/>
</h:commandLink>
</h:panelGroup>
</f:facet>
<f:facet name="corbeilles">
<h:panelGroup>
<f:facet name="expand">
<t:graphicImage value="images/yellow-folder-open.png" rendered="#{t.nodeExpanded}" border="0"/>
</f:facet>
<f:facet name="collapse">
<t:graphicImage value="images/yellow-folder-closed.png" rendered="#{!t.nodeExpanded}" border="0"/>
</f:facet>
<h:outputText value="#{node.description}" styleClass="nodeFolder"/>
<h:outputText value=" (#{node.childCount})" styleClass="childCount" rendered="#{!empty node.children}"/>
</h:panelGroup>
</f:facet>
</t:tree2>
</h:form>
</ui:define>
</ui:composition>
</body>
</html> |
Merci d'avance
commandlink how to pass parameter to next