Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSF Dirty check

 
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: 17290
9
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.
 
Don't mess with me you fool! I'm cooking with gas! Here, read this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!