数据表中的jsf2 f:ajax渲染问题 [英] jsf2 f:ajax render issue in datatable
本文介绍了数据表中的jsf2 f:ajax渲染问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个数据表,每行都有一个delete link命令,如下所示:
I have a datatable and for each line have a delete linkcommand, as following:
<h:dataTable value='#{glbProjectDtoList}' var='projectDto'
binding='#{projectController.projectDataTable}' styleClass='display'
id='tblProject' rowClasses='gradeA, gradeA'
columnClasses='projectTableName, projectTableProgress, projectTableAction'>
......
<h:commandLink
action="#{projectController.delete(projectDto.projectId)}">
<img class="btnDeleteProject mr5"
src="#{request.contextPath}/resources/images/icons/dark/trash.png" />
<f:ajax execute="@form"
onevent="function(data) {deleteProjectEventHandler(data);}"
render=":tblProject" />
</h:commandLink>
......
</h:dataTable>
delete函数可以正常工作,但是整个数据表都不会重新呈现,是因为操作嵌套在数据表中还是由于其他原因?
The delete function works fine, but the whole datatable is not reRendered, is it because the action nested in data table or by some other reason?
更新:
它不起作用,删除(:)后,引发以下异常:
It's not working, after remove (:), throw following exception:
javax.faces.FacesException: <f:ajax> contains an unknown id 'tblProject' - cannot locate it in the context of the component j_idt68
表示不包含(:),该元素必须位于同一h:form标记中.
means without (:), the element must be in same h:form tag.
谢谢.
-母牛
推荐答案
我采用了另一种方法,在表外使用隐藏表格.可以.
I have go another approach, use hiding form outside of the table. It works.
谢谢大家;)
这篇关于数据表中的jsf2 f:ajax渲染问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文