This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSF Dirty check  RSS feed

 
Pradeep Chandrasekharan Nair
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on a project using JSF/Seam1.2/Hibernate. My requirement is that if in a form nothing is changed, it should not submit the form saying that "Nothing is changed for Save".

How can I check in JSF that none of the fields in the form are changed?

Thanks in Advance

Regards,
Pradeep
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Great question. Let me see if I can find anything, because I think we need the same thing.

I believe you could listen in on the phases and in between one of them, not sure which one though, you should be able to see the old values and the new values, and if they are different set a dirty flag.

Or, but I think this might be too much traffic, is that your UIInput items can have a valueChangeListener, that fires and gets a valueChangedEvent which has a newValue and an oldValue that you can check and set a boolean flag in your bean.

Mark
 
Krithika Srinath
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Interesting question.

Browse through this thread.

Looks promising. I'm also planning to try this out. Will post back with results.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!