0

MVVM: Prevent @NotifyChange in case of an Exception

asked 2012-09-13 08:04:53 +0800

paddel10 gravatar image paddel10
3

updated 2013-08-01 05:41:41 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

Hi,

Is it possible to prevent a @NotifyChange event if the corresponding function fails?

Example:

@Command
@NotifyChange("status")
public void save() {
  // write item to database fails
  // question: what to do? throw exception? set flag?
}

Thank you for your help, Patrick

delete flag offensive retag edit

3 Answers

Sort by ยป oldest newest most voted
1

answered 2013-08-01 05:45:13 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

You can do like this

@Command
 public void save() {
    try{
    //Write your business logic inside try block
    //Last line will be
     BindUtils.postNotifyChange(null, null, YourClassNameOrObject, "*");
    }
      catch(Exception e){
    //If any line of code throw exception BindUtil will not call.And control comes here
    {

}
}
link publish delete flag offensive edit
0
link publish delete flag offensive edit
0

answered 2013-08-01 04:20:51 +0800

Senthilchettyin gravatar image Senthilchettyin flag of India
2611 3 8
http://emrpms.blogspot.in...

You can use BindUtils.postNotifyChange

See help here

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2012-09-13 08:04:53 +0800

Seen: 64 times

Last updated: Aug 01 '13

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More