Revision history [back]

click to hide/show revision 1
initial version

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

edwpotapoff gravatar image edwpotapoff

MVVM improvement

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)"/>

MVVM improvement

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)"/>

comment under VIRTUAL STATE LICENSE

MVVM improvement

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)"/>

comment post under VIRTUAL STATE LICENSE

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