我有一份文件清单,我需要立即更新所有文件 . 我做了这样的事情:
<ui:repeat id="r_list" value="#{tareaController.controlador.documentosIndexar}" var="documentos" >
其中 documentosIndexar
是文档列表 . 它显示所有文档及其属性 . 我有两个 panelGrid
,一个是文档的查看者,另一个是信息 . 在信息的底部有文件清单 .
我需要填写文档's information then select another one without losing the previous one. I' m试图更新整个 ui:repeat
并且它渲染下一个文档及其信息,但前一个文件的信息丢失了 . 我也尝试过:
<ui:repeat id="r_list">
<p:panelGrid id="pg_document" rendered="#{tareaController.controlador.documentoSeleccionado.id eq documentos.id}">
<---- Document components here ---->
<p:ajax event="rowSelect" update=":f_tarea:r_list:pg_document" listener="#{tareaController.controlador.reemplazarLista(tareaController.documentoSeleccionado)}"/>
</p:panelGrid>
</ui:repeat>
我的所有组件,以及我的页面都在一个名为 f_tarea
的表单中,该表单来自其模板 . 当我执行上述操作时,我从列表中更新 panelGrid
,但只是那个,并且渲染条件中的变量发生了变化,所以 panelGrid
消失了 . 基本上,我想要做的就是更新ui:repeat中所有panelGrids上的渲染条件,这样一个隐藏,另一个隐藏,而不会丢失前一个的信息 .
1 回答
好 . 对不起,我是一个完全愚蠢的人 . 我尝试过以前没做过的事情:下载PrimeFaces手册 . 在AjaxBehavior部分,有一个“进程”处理部分请求中的组件 . 我只是通过这样做来修复它:
我不会删除这个问题,以防将来帮助某人 .