-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I have a HtmlMacroComponent that is embeded in a form defined as:
<vlayout form="@id('fx') @init(vm.fxForm) @load(vm.selectedProduction) @save(vm.selectedProduction, before='onUpdateProduction') @validator(vm.productionValidator)">
<hbox align="center" hflex="1" />
<grid hflex="1">
<columns>
<column valign="top" align="right" hflex="min" />
<column />
</columns>
<row>
<cell sclass="row-title">
Producer(s) :
</cell>
<cell>
<clientSelector descriptor="Producers" userList="@load(fx.producers) @save(fx.producers, before='onUpdateProduction')" hflex="1" />
</cell>
</row>
</rows>
</grid>
<hlayout>
<button onClick="@command('onUpdateProduction')" label="Update" />
<button onClick="@command('reloadProduction')" label="Reload" />
</hlayout>
</vlayout>
My custom macro component <clientSelector>
works correctly when databinding is defineded like the above. However, if I define databinding like:
<clientSelector descriptor="Producers" userList="@bind(fx.producers)" hflex="1" />
using the short hand @bind instead of @save and @load the value is not updated on the intermediate form object before the command operation. I thought the before='onUpdateProduction'
would take care of this on its own? Why does the long form work but the short form not?
Because @bind
doesn't accept conditional binding keyword before
and after
. The binder saves value to ViewModel according to certain event specified in lang-addon.xml
please refer to http://books.zkoss.org/wiki/ZKDeveloper%27sReference/MVVM/Advanced/BindingAnnotationforaCustom_Component
Asked: 2014-11-02 14:43:49 +0800
Seen: 24 times
Last updated: Nov 11 '14
How to load markers dynamically on zk gmap
Possible bug in Combobox component
composite component help [closed]
EL in a forEach @command not working?
Different template for each grid row
Cardlayout animation is broken
Grid RowRender slow using 6.5.1 and sizable=true
i have similar problem, so i wait ther for answer
czoki ( 2014-11-03 08:36:21 +0800 )edit