在我基于JSF2的申请表中,我有一个表格,包括(除UI的其他组成部分外)一些复选框。
On the checkboxes I have registered ajax requests that fire when they are checked. The ajax requests will actually just update the value of another checkbox in the backing bean. As a result the other checkbox will also be checked (when it gets re-rendered - as it will take the updated value from the backing bean in the render response phase).
This works fine until the whole form gets submitted and validation errors occur.
Then the ajax requests still work and change the value on the backing bean but in the phase of re-rendering the updated checkbox the value for it is not taken from the backing bean but from a cached value that is taken from a ComponentStateHelper
class.
据我所知,这被用于JSF 2的新特点,只储存对树组成部分的部分改动。
我不明白的是:这与验证阶段有什么关系?为什么在验证发现错误时我的复选框的 StateHelper
类中有一个缓存值?