如何找到ajax update / render組件的客戶端ID?找不到帶有“bar”引用的表達(dá)式下面的代碼是從PrimeFaces的DataGrid + DataTable的教程啟發(fā)和放入<p:tab>一個(gè)的<p:tabView>居住在<p:layoutUnit>的<p:layout>。這是代碼的內(nèi)部部分(從p:tab組件開始); 外部是微不足道的。<p:tabView id="tabs">
<p:tab id="search" title="Search">
<h:form id="insTable">
<p:dataTable id="table" var="lndInstrument" value="#{instrumentBean.instruments}">
<p:column>
<p:commandLink id="select" update="insTable:display" oncomplete="dlg.show()">
<f:setPropertyActionListener value="#{lndInstrument}"
target="#{instrumentBean.selectedInstrument}" />
<h:outputText value="#{lndInstrument.name}" />
</p:commandLink>
</p:column>
</p:dataTable>
<p:dialog id="dlg" modal="true" widgetVar="dlg">
<h:panelGrid id="display">
<h:outputText value="Name:" />
<h:outputText value="#{instrumentBean.selectedInstrument.name}" />
</h:panelGrid>
</p:dialog>
</h:form>
</p:tab></p:tabView>當(dāng)我單擊時(shí)<p:commandLink>,代碼停止工作并給出消息:找不到表達(dá)式為“insTable:display”的組件,引用自“tabs:insTable:select”。當(dāng)我嘗試相同的使用時(shí)<f:ajax>,它失敗了,基本上告訴相同的不同消息:<f:ajax> 包含一個(gè)未知的id“insTable:display”無法在組件“tabs:insTable:select”的上下文中找到它這是怎么造成的,我該如何解決?
4 回答

RISEBY
TA貢獻(xiàn)1856條經(jīng)驗(yàn) 獲得超5個(gè)贊
這是因?yàn)檫x項(xiàng)卡是一個(gè)命名容器以及...你的更新應(yīng)該是update="Search:insTable:display"
你可以做什么,只是將你的對話框放在表單之外,仍然在選項(xiàng)卡內(nèi),然后它將是:update="Search:display"
添加回答
舉報(bào)
0/150
提交
取消