环境:Tomcat 6,jsf 2.0,prime faces 2.2.1,chrome explorer
我想单击左侧展开树中的“ViewDetail”链接并显示产品的详细信息。但是下面的代码不起作用。然后我将属性 ajax="false" 添加到链接中,它似乎有效。但是位于页面左侧的“p:treeTable”也被刷新和折叠。那么我该怎么做:单击左侧展开的树节点上的链接,在页面右侧显示信息,并保持左侧展开的树节点仍处于展开状态。
<h:form id="BizTypeTreeTableForm" >
<p:layout fullPage="true">
<p:layoutUnit id="left" position="left" scrollable="true" width="350" resizable="true" closable="false" collapsible="true" minWidth="250" >
<p:treeTable id="BizTypeTreeTable" value="# {treeTableController.root}" var="treeTable">
<p:column>
<f:facet name="header">ProductName</f:facet>
<h:outputText value="#{treeTable.TYPENAME.value }" />
</p:column>
<p:column style="width:5%">
<f:facet name="header">Action</f:facet>
<p:commandLink value="ViewDetail" update="content" action="#{treeTableController.showDetail}">
</p:commandLink>
</p:column>
</p:treeTable>
</p:layoutUnit>
<p:layoutUnit id="center" rendered="true" position="center" style="text-align:left;" scrollable="true" >
<h:outputText value="Please click the left tree node" rendered="# {allTabManager.productObject.TypeNo.value eq null}"/>
<div id="content" class="ui-widget">
<div class="post">
<ui:insert name="content_tab" >...</ui:insert>
</div>
</div>
</p:layoutUnit>
</p:layout>
</h:form>