[英]How to reRender a rich:dataTable which is inside a4j:repeat?
I have sth like this: 我有这样的事情:
<a4j:repeat value="#{results}" var="hdr" rowKeyVar="idx">
<rich:dataTable var="item" value="#{results}" id="tbl#{idx}" first="#{idx}" rows="1">
<a4j:commandButton value="update this table only" reRender="tbl#{idx}" />
</rich:dataTable>
</a4j:repeat>
When I check from the output html, the data table has id like form:0:tbl that has no idx at the end. 当我从输出html检查时,数据表的ID像form:0:tbl一样,结尾没有idx。
The reRender will work when there is only one row in the results. 如果结果中只有一行,则reRender将起作用。
So here comes some questions: 因此,这里出现一些问题:
In fact I have successfully reRendered the whole a4j:repeat block surrounded by s:div. 实际上,我已经成功地重新渲染了s:div包围的整个a4j:repeat块。 But refreshing the whole block would reset the scrollbar so it isn't desired.... 但是刷新整个块会重置滚动条,所以这是不希望的。
For 1, it is possible that the life cycle of the table is in a different phase. 对于1,表的生命周期可能处于不同的阶段。
For 2, it refers to UIComponent.findComponent in fact for looking up a component given an ID. 对于2,它实际上是指UIComponent.findComponent,用于查找具有ID的组件。
For 3, perhaps try to use UIComponent.findComponent() or #{rich:clientId('id')} to see whether the actual HTML element ID of the a4j:repeat embedded rich:dataTable to be retrieved. 对于3,也许尝试使用UIComponent.findComponent()或#{rich:clientId('id')}来查看是否要检索a4j:repeat嵌入的rich:dataTable的实际HTML元素ID。
If yes, then somehow reRender can be made to work. 如果是,则可以使reRender正常工作。 If no, look if there is anything that can override how reRender looks for component. 如果没有,请检查是否有任何东西可以覆盖reRender查找组件的方式。
Okay latest experiment shows that simply using the rich:dataTable id can do. 好的最新实验表明,只需使用rich:dataTable id即可。
Keys to remember: 要记住的关键:
Conclusion, think too much, failed to try the simplest solution at the start. 结论,想得太多,一开始就没有尝试最简单的解决方案。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.