-1

MVVM improvement

asked 2015-12-23 16:50:10 +0800

edwpotapoff gravatar image edwpotapoff
43 1

updated 2015-12-25 21:09:28 +0800

If ViewModel's property is a map, we can write:

<label value="@load(vm.myMapping['myKey'])"/>

But then, when we need to update the label, we must write:

BindUtils.postNotifyChange(null, null, this, "myMapping");

So all properties from myMapping in the View will be updated instead of one - myKey. It would be great if the property in this model was myKey, so we can write:

BindUtils.postNotifyChange(null, null, this, "myKey");

Even for a lable like:

<label value="@load(vm.myFunction('myKey'))"/>

It would be great if in ViewModel we can define two methods:

Object getProperty(String name)
void setProperty(String name, Object value)

So in View we can call:

<label value="@load(vm.myKey)"/>

post under VIRTUAL STATE LICENSE

delete flag offensive retag edit
Be the first one to answer this question!
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: 2015-12-23 16:50:10 +0800

Seen: 32 times

Last updated: Dec 25 '15

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