我有一个JSP 2.0 <ui:component>
,其中是一个<p:dataTable>
与一列使用复合呈现关于某些内容的特殊边框。现在我需要确定位于内容中的ajax呈现属性中的<p:dataTabe>
。如何访问复合材料的父命名容器?
<ui:component>
<p:dataTable id="dataTable" var="userItem" ... />
<p:column>
<my:borderBox id="borderBox">
<p:commandButton
action="#{userController.doDelete(userItem.id)}"
value="delete"
update="?????"/> <!-- How to address the dateTable? -->
</my:borderBox>
</p:column>
</p:dataTable>
<ui:component>
我BorderBox:
<html xmlns:composite="http://java.sun.com/jsf/composite" ...>
<composite:interface>
<composite:attribute name="styleClass" default="" type="java.lang.String"/>
</composite:interface>
<composite:implementation>
<h:panelGroup ...>
...
<composite:insertChildren/>
</h:panelGroup>
</composite:implementation>
我的想法是使用类似
update=":#{component.namingContainer.parent.namingContainer.clientId}:dateTable
但component.namingContainer.parent
接缝为空。
当我更换<p:commandButton>
此声明:
Parent ClientId 1: #{component}
Parent ClientId 2: #{component.namingContainer}
Parent ClientId 3: #{component.namingContainer.clientId}
Parent ClientId 4: #{component.namingContainer.parent}
Parent ClientId 5: #{component.namingContainer.parent.namingContainer}
我得到这样的输出:
Parent ClientId 1: [email protected]
Parent ClientId 2: [email protected]
Parent ClientId 3: main_form:profilTabView:dataTable:0:borderBox
Parent ClientId 4:
Parent ClientId 5:
我不知道什么问题吧:mybey我的想法,以确定完成列表错误或有一些错误或有更好的方法? (但我不能用固定绝对identifyer为dateTable!)
版本:Primeface 3.2,钻嘴鱼科2.1.6在Glassfish 3.1.2
不幸的是我不使用'ui:component'标签,所以我对它不了解太多;我通常使用复合组件,您可以从EL表达式中引用父命名容器,如'#{cc.parent.id}'。不过,我认为'parent'是EL表达式语言中的一个保留变量,所以它应该像'#{parent.id}'一样简单,以检索父命名容器标识符。 –
@maple_shaft:''被复合组件隐式使用。因此,直接声明而不是''更清晰。 –
BalusC
您正在使用哪个JSF impl /版本和PF版本? – BalusC