How to find the changes in the Bean
I have 3 tabs.Each of which contain a form with a save button.In Edit mode after making some changes,if i goto another tab i have to show one alert saying save the modified changes. How can i find the difference between saved data and modified data in jsf. What is the 开发者_运维百科easiest way to do this.
just compare the Model that is there in DB and the one coming from view , using fields those are exposed to view, it can also help for dirty check mechanism and can save DB calls
We normally store a copy of the saved state in order not to have to go down to the DB again. After saving both the editable and the "original" copy are updated. This way we also can offer a "reset" option.
精彩评论