what does it mean when i write something like below
<textbox value="@load(vm.address.streatName)"/>
<datebox value="@save(vm.trip.leaveDate)"/>
<label value="@bind(vm.name)"/>
thanks in advancethey all are the annotations used for data binding by MVVM in ZK and they do exactly what their name suggest they do i.e.
@load(...): used to bind data and command along with parameters for loading data to target
@save(...): used to bind data and command along with parameters for saving data.
@bind(...): used to bind data along with parameters for both loading and saving.
@bind(...) is shortcut for "@load(...) @save(...)", and @save is automatically ignored if the property doesn't support it
<textbox value="@load(vm.address.streatName)"/>This will load the value of your textbox from the property streatname of bean address
<datebox value="@save(vm.trip.leaveDate)"/>this will save or update or modify the value of datebox to the property leaveDate of bean trip
<label value="@bind(vm.name)"/>this will bind the value of label to property named name of vm and onChange or value the label value will also change.They all will reflect the changes done to binding property if you choose to do so, while building your bean with the help of annotation like @NotifyChange etc.
I hope i was able to clear some doubts.
No comments:
Post a Comment