1
我想通過命令鏈接使用Ajax來更新對話框。特形式沒有任何的ID,我不能也運行這個頁面,它說組件與「對話」沒有找到/不存在素面命令鏈接ajax不工作
<h:form>
<p:tabView id="tabView">
<p:tab id="tab1" title="Tab 1">
<h:panelGrid columns="1" cellpadding="10">
<h:dataTable value="#{testBean.dataList}" var="data">
<h:column>
<h:outputText value="#{data}" />
</h:column>
<h:column>
<p:commandLink action="#{testBean.loadCommentHistory(data)}"
update="dialog" oncomplete="dlg.show()">
<h:graphicImage url="resources/theme1/images/comments.gif"
styleClass="basicImageStyle" />
</p:commandLink>
</h:column>
</h:dataTable>
<p:dialog id="dialog" header="Dynamic Dialog" widgetVar="dlg">
<h:outputText value="#{testBean.commentHistory}" />
</p:dialog>
</h:panelGrid>
</p:tab>
</p:tabView>
</h:form>
這是我可以在瀏覽器頁面源碼 - j_idt7:tabView:對話框 –
試圖給這個更新=「:tabView:對話框」,仍然沒有用 –
給你的表單一個id('form id =「formId」' )並使用'update =「:formId:tabView:dialog」'。第一個「:」是指頁面的根元素。 – siebz0r