0

MVVM and server push [closed]

asked 2013-02-14 02:32:53 +0800

simulacrum gravatar image simulacrum
2 1

I'm using MVVM, trying to update some data in a non HTTP thread and then have server push send the notify the binder that the data has changed. However, I can't seem to figure out how to do it.

I put together a quick ZK fiddle to demo my problem here: zkfiddle.org/sample/2nnnbu2/2-MVVM-and-server-push.

I would have hoped that clicking the Asynch update would update the values in the complete column and an item would be added to the list asynchronously. However, it doesn't seem to work, even though the model data is being changed (as you can see by clicking the reload button after the asynch button).

Is there a way of using Server Push with MVVM?

delete flag offensive retag edit

The question has been closed for the following reason "the question is answered, right answer was accepted" by sjoshi
close date 2013-02-19 05:39:23

Comments

Right, great catch, thanks. I could also have used "OuterClass.this" instead of "this" for the "BindUtils.postNotifyChange(null, null, ViewModel.this, "data");" line inside the anonymous inner class.

simulacrum ( 2013-02-19 05:12:18 +0800 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2013-02-16 05:26:55 +0800

rdgrimes gravatar image rdgrimes
735 7

updated 2013-02-16 05:51:37 +0800

Try my version. See link. Remember that accessing outer class properties from an anonymous inner class has its complexities. I have always found it more effective that, if you're going to update outer class properties from an anonymous inner class, call a method at the outer class level to do the updating.

link publish delete flag offensive edit

Question tools

Follow
2 followers

RSS

Stats

Asked: 2013-02-14 02:32:53 +0800

Seen: 58 times

Last updated: Feb 19 '13

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