Prevent caching data of a dataTable

眉间皱痕 提交于 2019-12-13 20:07:44

问题


I have a ice:dataTable and in each row, there is a inputText. The record list is updated every time when fire a valueChangeListener on some other component. When it resets the record list, browser shows the previous values for inputText fields in table rows.

I tried both Filter and <meta/> tags. It didn't work for me. Can somebody tell me how to get rid of this problem? (Backing bean keeps the actual record list)


回答1:


This is a JSF problem, take a look at the following answer for details

Input fields hold previous values only if validation failed

To make it simple JSF keeps values in the partialViewContext so all what you have to do to reset all components in the partialViewContext

or if you are using primefaces you can simply add < p:resetInput target="tableId"/> to the field (nested inside) or if you are using OmiFaces then you can use ResetInputAjaxActionListener



来源:https://stackoverflow.com/questions/15104690/prevent-caching-data-of-a-datatable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!