Prevent caching data of a dataTable

2019-08-29 12:04发布

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条回答
Luminary・发光体
2楼-- · 2019-08-29 12:37

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

查看更多
登录 后发表回答