我试图在primefaces基本树中使用commandLink,commandLink在主节点中工作正常,而在子节点中什么都不做。
<?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:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
<h:form>
<p:commandLink value="Add Component" action="#{subComponentManagedBean.addSubComponentFormNavigation()}" />
<br><h:outputText value="Componet Tree Demonstration" style="color: blue;font-weight: bold;padding-bottom: 10px;text-align: center;"/>
<p:tree value="#{subComponentManagedBean.componentTree}" var="node" id="treeSingle" style="border:none;width: 100%;" >
<p:treeNode >
<h:outputText value="#{node.componentName}" /> <p:spacer width="100" height="0" />
<p:commandLink id="tot#{node.componentId}" ajax="false" value="Add" action="#{subComponentManagedBean.addChildComponent(node)}" /><p:spacer width="100" height="0"/>
</p:treeNode>
</p:tree>
</h:form>
</html>