问题
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